Jump to content

Guide - Scripting - Enabling / Disabling Cursor


Recommended Posts

Scripting - Enabling / Disabling Cursor 

How To

By Matty




Once you are on that page, Locate to the file that has the exact name and click on it and download it.



Step 1

Extract the Download of dnSpy, Right click the file and press Extract Here


Step 2

Open dnSpy by locating to "dnSpy.exe"


Step 3

Once dnSpy is open, Locate to the tab that says File, image.png.dc4a61b58782dbb6cdfc7627f7919893.png

Click Open and Locate your Flashing Lights Folder > flashinglights_data > Managed > and Select "Assembly-CSharp.dll"image.png.1d8912a30b4d27570a59725eef76a526.png 


Step 4

Click on the Arrow on the Left hand side on the Assembly-CSharp


Click the same arrow on this


Locate and Find "UnityEngine.PostProcessing"


Step 5

In the UnityEngine.PostProcessing tab, Locate "PostProcessingBehaviour"


Open PostProcessingBehaviour (Should look like this, image.png.b1d2deec30008c66ce82513a9440eea6.png)

Step 6

Scroll Down in the tab on the right hand side and locate OnGui (Photo Attached) image.png.e250e8dd46ef77d57e4bd346a2470a73.png

Right Click in any area on the private void OnGui and Click Edit Method(C#)


Step 7

Type Enter after the '{' and Paste in this 

if (Input.GetKeyDown("right alt")) {

Cursor.visible = true;

Screen.lockCursor = false; 


if (Input.GetKeyDown("left alt")){

Cursor.visible = false;

Screen.lockCursor = true;



Your Screen should now look like this.


Press Compile and Press "Ctrl + Shift + S"


and press ok and close dnSpy

Step 8

Load up Flashing Lights and go start a game up and select a role and you should now be able to enable the cursor by pressing "right alt" and disabling it by doing "left alt". 



Why is this useful?
This "Script" if you want to call it that is useful for when FLModders Modding Team releases more scripts that include Mod Menus Etc.


If you have any more questions, Feel free to ask me on discord, Matty#1281 or join the Flashing Lights Modders Official Discord!


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...