Rotation to a vector3 for camera

n00b stuff, sorry.

I’m trying to get a camera script to follow a rigidbody’s direction of inertia (so the camera wont spin out with the object)

My question is—
Is dampened rotation toward a velocity vector from a rigidbody (rather than the transform) going to cause any bizarre behavior, or be super slow?

If it’s okay, what is a good way to convert a world space vector3 (velocity) into a quaternion to rotate towards?

Using the Smooth Follow Script has caused some severe jitter–so i’d like to avoid that too–I haven’t discovered the cause yet, except it’s probably something in the lerping (based on fiddling with the dampening settings)

http://unity3d.com/Documentation/ScriptReference/Transform.LookAt.html

Is this what your looking to do?

Cheers,

You want to enable interpolation on the rigidbody the camera is follwing to avoid the jitter.

Awesome, thanks, joachim

I was under the impression ‘look at’ looked at a point in world space.

I need it to align with a vector ( a point in space assuming the origin is always the camera i guess…)

Maybe i’ll just add the velocity vector to the camera’s position vector and see what happens.

Still quite bumpy at high velocity–

It seems to be directly related to the height dampening–as i’m changing height constantly.

I’m going to experiment locking distance

The jerkiness can also be a sign of what order the math is done before updating the camera.

fixedUpdate()
Update()
LateUpdate()

Cheers,