Camera parenting

Hi,

I’m obviously missing something trivial - I have an object B parented to object A. Object B has both position and rotation reset so it lies at object A’s pivot.

Now I attach a Camera to object B and reset its position and rotation too so all the three object are at the same place. Now when I try to adjust Camera position, its parent Object B start to change position too… How is this possible? How can child’s transform adjustment affect its parent? Basically it seems to move so it’s always half the way between the Object A and the Camera…
This happens both when doing it in editor and script.

It just got to be something really obvious and it drives me mad :slight_smile:

Did you make an empty object C, attach camera to that, then parent it under B? Or is the camera ON object B? Sounds like the latter. Object B has both transform and camera, right?

If you want the camera to be independant in position from object A, it should not be parented at all anywhere under object A. It should use LookAt with A’s transform as the target. http://unity3d.com/support/documentation/ScriptReference/Transform.LookAt.html

In other words - what I’m trying to do is for the camera to watch a certain object - camera interest point that can be attached to a character. Then I could rotate the camera around the character by simply rotating the watched object while still having the camera moved with the character.

So it’s linked like this character ← camera interest point ← camera. The problem is, that when I start to move the camera away, the camera interest point starts moving too. I’ve never seen parent object being moved by adjusting its child so I’m a bit confused :slight_smile: It seems like a bug to me…