Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var KeyIsPressed = false;
- var gun1 : GameObject;
- var gun2 : GameObject;
- function Update () {
- if(Input.GetKey(KeyCode.E))
- KeyIsPressed = !KeyIsPressed;
- if(KeyIsPressed) {
- gun1.gameObject.SetActive(false);
- gun2.gameObject.SetActive(true);
- if(!KeyIsPressed) {
- gun1.gameObject.SetActive(true);
- gun2.gameObject.SetActive(false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment