- Home /
This question was
closed Jan 03, 2013 at 01:27 AM by
Seth-Bergman for the following reason:
Duplicate Question
How to alter input to continuous rather than tap?
My code works perfectly in rotating a cube around both axis' (axees?) My problem is that you have to continuously tap a key to get it to move in the desired direction, how do I make it so that holding the key down moves it in that direction continuously, rather than just once, and at the same speed.
Code:
var speed = 5000;
function Update ()
{
if(Input.GetKeyDown("left")){
transform.Rotate(0, 0, Input.GetAxis("Horizontal") * speed * Time.deltaTime,Space.World);;
}
Also, that "var speed = 5000" doesn't actually seem to be changing anything, thats why it's at such an insanely high number. How do i speed up the rotation?
Comment
Follow this Question
Related Questions
How to alter input to continuous rather than tap? 0 Answers
How to alter input to continuous rather than tap? 1 Answer
Input Help! 1 Answer