Quantcast
Channel: Latest Questions by Red Sentinel
Viewing all articles
Browse latest Browse all 38

Play Animation on Button Down

$
0
0
Hi everyone. I've been trying to get a specific animation to play when the player presses w, a, s or d. Whenever I press w, a, s or d though, nothing happens. This is what I have already. Could anyone tell me what's wrong? var ForwardAnimation : Animation; var BackwardAnimation : Animation; var RightAnimation : Animation; var LeftAnimation : Animation; function Start () { } function Update () { if (Input.GetButtonDown ("w")){ animation.Play("ForwardAnimation"); } if (Input.GetButtonDown ("s")){ animation.Play("BackwardAnimation"); } if (Input.GetButtonDown ("d")){ animation.Play("RightAnimation"); } if (Input.GetButtonDown ("a")){ animation.Play("LeftAnimation"); } }

Viewing all articles
Browse latest Browse all 38

Trending Articles



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