I am making an FPS Parkour game where the player will be able to do flips. ‘e’ key to flip forward, ‘q’ key to flip backward. I used a simple rotation script. The problem is that sometime the x,y, and z rotation axis’s need to be reset. Using other scripts and my own skills, I wrote this simple script.
var TargetObject:Transform;
function Update()
{
if (Input.GetKey("r"))
{
TargetObject.Rotation=Quaternion.Euler(Vector3(0,0,0));
}
}
It is not working and I get an error that says this.
MissingFieldException: Field ‘UnityEngine.Transform.Rotation’ not found.
Any suggestions?