Quantcast
Channel: Latest Questions by MrGravyCakes
Viewing all articles
Browse latest Browse all 12

Open Door on Keypress Not Working - Animations

$
0
0
I have added the animations and done all the code but the door will not open. Please could you have a look at the code and see what is happening? C# please :) using UnityEngine; using System.Collections; public class DoorControl : MonoBehaviour { private Animation _anim; public bool doorOpen; void Start() { } void Update () { if(Input.GetKeyDown(KeyCode.Q)) { OpenDoor(); } } void OpenDoor() { if (doorOpen == true) { _anim.Play ("ClosingAnimation"); doorOpen = false; } else { _anim.Play("OpenAnimation"); doorOpen = true; } } }

Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>