Hi there, I am creating a racetrack with a sphere on it that will be my "car". Just an exercise for code stuff. I have troubles understanding how I can only rotate my camera around an ax I want (e.g when the race track heads left, and I steer left, the camera rotates in 1 ax, I dont want the camera to roll like the sphere itself. I am looking for the right syntax, e.g in pseudocode: Code (csharp): transform.rotate(transform.pitch, transform.yaw, target.roll); here's the code: Code (csharp): var target : Transform; var distance = 10.0; var height = 10.0; function LateUpdate () { if (!target) return; // align this camera to the target position targetPosition = target.position; transform.position = targetPosition; transform.position.y += height; // and now make sure the camera only rotates // in the ax we want. targetRotation = target.rotation; // STUFF HERE - What do I do now? } I'll do some "lerping" later on.
ps: I don't understand "perpendicular to worldUp", my English ain't that good! Could someone explain this please? Thanks!
perpendicular means orthogonal. Or an angle of 90 degrees between the forward and upVector in this case.
Thanks a lot Joachim! It's still going beserk though But why should I use eulerAngles in this case? Why is there a difference between eulerAngles and Quaternions?