I can’t seem to get an object that I have moving with WASD to face the direction it’s moving in.
I’ve tried some invisible targets but I feel that’s over complicating it. Some help or a step in the right direction (been on google for an hour looking at transform.LookAt and Quanternion stuff) would be nice. I haven’t a clue how to start this. here’s the code so far.
Something like this?
if (moveDir != Vector3.zero)
{
transform.rotation = Quaternion.LookRotation(moveDir);
}
Something like this maybe?
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(Target.position - transform.position),
7*Time.deltaTime);