#Look rotation viewing vector is zero

1 messages · Page 1 of 1 (latest)

hasty bluff
#

this message start logging into my console when the player is idle when I added "Slerp" to make the player face the direction it is moving

float rotateSpeed = 10f;

        transform.forward = Vector3.Slerp(transform.forward, moveDir, Time.deltaTime * rotateSpeed);
civic parrot
#

Its because moveDir is a zero vector when that message is displayed

#

wrap your slerp call with something like:

if (moveDir != Vector3.zero) 
{

}
#

Slerping to a zero vector doesnt make sense, so it puts this in the console to give a heads up