child object problem

:wink:
Of Unity basics, it’s easy to make object child of another parent object (join with Hierarchy panel) this is not the problem …

suppose a scene contains rigidbody sphere moving with arrow keys, inside this sphere a gameobject, this gameobject child of sphere, the question here:

How can make this gameobject not follow sphere rotation, but follow sphere position only?

overwrite the child rotation every frame. Or don’t make the child a child of the sphere, but assign the sphere position to the child position every frame.

can you explain with script guide lines, if you please

var childTransform : Transform;
function LateUpdate() {
   childTransform.rotation = Quaternion.identity;
}

or

var childTransform : Transform;
var parentTransform : Transform;
function LateUpdate() {
   childTransform.position = parentTransform.position;
}

or just attach this to your child object so that it it stays at rotation (0,0,0);

function LateUpdate() {
   transform.rotation = Quaternion.identity;
}

you helped me with these few lines… :wink:
Thanks … (“Shokran” in Arabic)