Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

toggle unity c#

private bool togl;//this is either true or false

        if (Input.GetKey(KeyCode.A)) //can have whatever statment you want here
        {							 
            togl = !togl; //this is what changes the bool
        }
 
PREVIOUS NEXT
Tagged: #toggle #unity
ADD COMMENT
Topic
Name
1+9 =