Hi im running in a problem since a while…and i dont know realy how…
look this is what i got.
a simple Waypoint system, wich works realy great.And i got a simple Waypoint follower wich moves from point to point.And now i want that the follower rotates with the waypoints z rotation.
Input is just the moving speed,rotation speed and at wich point the follower should start Rotation.
a lil snipped
Quaternion rot = pathContainer.WayPoints[startRotID].transform.rotation;
// get rotation from wayPoint
TotalRotationToDestination = pathContainer.WayPoints[startRotID].transform.rotation.z;
//get the value from z
float currentDuration = Time.time - StartTime;
float rotTime = currentDuration / TotalRotationToDestination;
//for lerpping
transform.Rotate(new Vector3(0,0, Mathf.Clamp(transform.rotation.z, startPos.z, destRot.z))); //should not overshoot the target
transform.rotation = Quaternion.Euler(0, 0, Mathf.Lerp(startPos.z, rot.z, rotTime));
//transform.Rotate(new Vector3(0, 0, Mathf.Lerp(startPos.z, destRot.z, rotTime))); <-dont work
it dosnt work at all.
Knows anybody how to solve this,i think its an easy Problem…
pls