Hi guys, I’m following a tutorial but I guess it’s a bit old, and I made this simple script to make a cube rotate, but it doesnt.
using UnityEngine;
public class Mover : MonoBehaviour {
float deltarotation = 30f;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
}
void rotate()
{
if(Input.GetKey(KeyCode.Q))
transform.Rotate(new Vector3(0f, -deltarotation, 0f) * Time.deltaTime);
else if (Input.GetKey(KeyCode.E))
transform.Rotate(new Vector3(0f, +deltarotation, 0f) * Time.deltaTime);
}
}
What am I doing wrong? Thanks!