- Home /
Cant Rotate twice?
For Some reason when i run this script the player only rotates once, while Turn is printed twice!
public void Navigate()
{
TurnAngle = 45f;
Invoke("Turn", 9f);
Invoke("Turn", 10f);
}
public void Turn()
{
transform.rotation = Quaternion.Euler(transform.rotation.x, transform.rotation.y + TurnAngle, transform.rotation.z);
Debug.Log("Turn");
}
Comment
Answer by DarshGupta · Dec 01, 2020 at 06:15 AM
Well you can try to do this instead of using Quaternions:
public void Navigate()
{
TurnAngle = 45f;
Invoke("Turn", 9f);
Invoke("Turn", 10f);
}
public void Turn()
{
transform.Rotate(0, TurnAngle, 0);
Debug.Log("Turn");
}
Please tell me if this works or not.
Your answer
Follow this Question
Related Questions
Animation Event don't show C# methods 1 Answer
run function once per frame 2 Answers
Auto generated script with more functions? 0 Answers