Follow target camera

Hi,

I’ve been spending too much time modelling and texturing then i have been keeping up on my programming the last month or two so i’m feeling quite stupid as it is.

So perhaps some of you are willing to throw me a bone on this. I got a character that move and turns and goes up slopes and i need a camera to follow the target from a set distance and not turn with the camera. I tried dragging the cam into the character but that just makes the camera turn when the character does. So i need it to have a set distance to the character along xyz.

Thanks in advance

There is a script implementing a physics-controlled follow camera attached to this thread. If this doesn’t have the behaviour you need then post again and let me know what I can do for you.

it’s not physics i’m after, it’s sort of like the camera in animal crossing, almost orthographic i dare say.

Just had an idea during dinner, i’ll just set a target for the camera and then it’ll get the transform position and move an ammount along the xyz axis and the update the position each frame. Correct me if this is stupid.

The easiest is just to do a direct mapping:

def SetCameraTarget(target as Transform):
    mTarget = target

def Update():
    transform.position = mTarget.position + mCameraOffsetVector
    transform.LookAt(mTarget)

And you can get fancier as your game demands it.