Does anyone knows how to rotate an object on the local axis “y”?
I make an object that only moves forwards with
rb.velocity = transform.forward * throwSpeed;
it can be rotated over the “y” axis. I can turn back if the object looks forward.
float rotationY = Input.GetAxis("Horizontal");
Vector3 newRotation = transform.localEulerAngles;
newRotation.y += rotationY * rotateSpeed;
rotateSpeed;
transform.localEulerAngles = newRotation;
When this looks up with an angle of 45° advance in that direction, but when i try to return, it turns back but is still looking up at 45° , so, the object keep going up.