- Home /
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?
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
How to use Multi-Tap in New Input System for Running? 1 Answer
Unity input system: TapInteraction does not produce a value when using ReadValue() 0 Answers
Using Xbox gamepad triggers as keys instead of axis? 1 Answer