Hello.
I’m trying to have an object look in the direction of its velocity, but also spin on its Z axis.
void Update ()
{
this.transform.Rotate(Vector3.forward, (500 * Time.deltaTime), Space.Self);
this.transform.rotation = Quaternion.LookRotation(mVelocity);
}
The problem is that the two functions over-ride each other. If I comment out the .rotation function, the object spins properly but doesn’t look in the right direction. If I leave the rotation function in code, the oject points in the right direction, but doesn’t rotate on its axis.
Any suggestions on making these two play nicely together?
thanks
David