Advertisement
LeeMace

Turn on or off

Apr 27th, 2023
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.26 KB | Gaming | 0 0
  1. //turn a thing on or off off of a keypress
  2. //The function sets the object to whatever it is not
  3.  
  4. public void Invisible() {
  5.  
  6.         if (Input.GetKeyDown(KeyCode.Space)) {
  7.  
  8.             practiceScriptMesh.enabled = !practiceScriptMesh.enabled;
  9.         }
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement