Quantcast
Channel: Answers by "Matt-Downey"
Viewing all articles
Browse latest Browse all 90

Answer by Matt-Downey

$
0
0
The problem is you are using "Left" and "Right" and a bunch of logical but nonetheless nonexistant buttons. Press Edit-->Project Settings --> Input and you can add "Left" and "Right" and so on if you so wish and your problem will be solved as long as you assign the buttons. On the other hand you can do things the conventional way and use Input.GetAxis. There a four premade axes, which are "Horizontal", "Vertical", "Mouse X", and "Mouse Y". This will actually simplify your code. var moveSpeed:float function Update () { transform.Rotate(transform.right, Input.GetAxis("Vertical") * moveSpeed * Time.deltaTime); transform.Rotate(transform.forward, Input.GetAxis("Horizontal") * moveSpeed * Time.deltaTime); }

Viewing all articles
Browse latest Browse all 90

Trending Articles



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