How Do I Offset a Childs Transform?

How Do I Offset a Childs Transform?

If I create an Empty GameObject and drag and drop for example a capsule to be the child object of the Empty GameObject. Why when I move the child object around the parent (Empty GameObject) takes the childs transform position? When I mention Move I mean literately not by code.

I cant seem to offset the transform of the Empty GameObject so that its at the bottom of a Capsule(child)? Its soo strange I was always able to do this in Unity before but Im thinking something has changed

My question is How do I put the Empty GameObjects transform at the bottom of the capsule (right now its always going to the childs center)?

Im using Unity 3.5.6f4

Are you saying that if you

  • create an empty game object at 0,0,0
  • drag a capsule onto it as a child
  • move the capsule around
  • then select the empty parent

you then see the parent at some other position than 0,0,0 ?

The gizmos usually show at the center of all drawable object in that hierarchy (in this case only the capsule is drawable), but the parent’s position should not change.

The parents position did not change when I followed your steps no matter where I put the child object (200 in Y) if I focus on the parent it will always goto where the child is.

The gizmos usually show at the center of all drawable object in that hierarchy (in this case only the capsule is drawable), but the parent’s position should not change.

I guess this is really throwing me off because in the past I could see where the parents transform (gizmo) is, now it just seems to, like you said goto the center of the drawable object no matter where I put the child.

Ahhh… My apologies, I finally figured it out. I couldn’t figure out why my follower capsule was going into the floor it seems it was in my code… Doh! not because of the transforms but because of a line of code that needed to be deleted.
target = GameObject.FindWithTag(“Player”).transform;
Problem solved. I seriously appreciate your responses it did help :slight_smile: