My Problem - i want to implement simple 360d. Cube -Rotation around Y-axis when i press the spacebar (so this Cube rotates itself only once when i press the spacebar and then stops) . How can i do this?
Heres my current code:
void Start () {
mSpeed = 3f;
RB = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update () {
transform.Translate(mSpeed*Input.GetAxis("Horizontal")*Time.deltaTime,0f,mSpeed*Input.GetAxis("Vertical")*Time.deltaTime);
//transform.Rotate(Vector3.up, 100 * Time.deltaTime);
if (Input.GetButtonDown ("Jump"))
{
RB.velocity = new Vector3 (0,5,0);
}
}