i am a beginner,
i made a small script that will turn off other scripts,
but i want that it on the same key turns a script off and turns a script on
i am a beginner,
i made a small script that will turn off other scripts,
but i want that it on the same key turns a script off and turns a script on
Try this:
function Update () {
if (Input.GetKeyDown ("space"))
GetComponent("cursorScript").enabled = !GetComponent("cursorScript").enabled;
}
And please try to place your code inside [ CODE ] in future posts. It makes code easier to read, and that in turn encourages people to help out.
D
thanks man!!
works perfectly!
Your script works perfectly, but i have a problem.
i made a small script so the cursor is not enabled
function Start () {
Screen.showCursor = false;
}
it works prefectly for the lockCursor script but for this script it (on the begging) desepears (it should) and when i press the key it shows and desepears again :c