Moving camera with player, but not rotating

Ok, I’m trying to accomplish the following:
3rd person top-down camera (not exactly top down, canted a few degrees)
Moves with the player
But doesn’t rotate with the player

I’m trying to think of some other game that does this for reference, but the only thing I can think of is the old Grand Theft Autos, and I can’t remember if the camera rotated as the player faced N/E/S/W. Wait, nevermind. Like Legend of Zelda (the NES one)

Is there some GameObject hierarchy chicanery that will let me do this, or should I build a script that will keep the camera’s location updated? I clearly can’t make the camera a child of the player, otherwise it will turn, and I can’t make them both children of a parent object:

HousekeepingObject
+--Player
+--Camera

Because the Player’s translations won’t be propagated up the tree.

I’m thinking a script might be the way to go, but it’s unclear if there will be some rediculous performance hit I can avoid by leveraging something that’s “built-in.”

Don’t worry. You are talking about a single camera with one script executing. If you intend to write a game there will be lots more scripts running, this one will never be a bottleneck.

Why not just something along those lines.

var target : Transform;
var offset  = Vector3 (0, 10, 10);
function LateUpdate () {
    transform.position =  target.position + offset;
}

Excellent point. I just tried this and it’s working really well. It’s a bit jarring when the character walks over bumpy areas in the terrain, but I imagine that can be fixed with a bit of Lerping. Plus the other advantage of doing this with a script is it should make it possible for that “offset” value to be dynamic based on how fast the player is moving.

Très magnifique!

If you do lerping, then i suggest you do it seperately for the y component and probably not for x-z component at all.

1.5.1 added an extremely handy smoothing function, that leads to much nicer results than lerp based damping:
http://unity3d.com/Documentation/ScriptReference/Mathf.SmoothDamp.html

He’s right about X, but I haven’t had any issues with the Z axis. I Lerp the position but keep X constant.