- Home /
Children Objects move weird
I have a GameObject (u1) that becomes the parent of another GameObject (u2) but after u2 is placed as a child under u1 something strange happens: when I tell u1 to go to a location u2 doesn't go with it, how do I make go along with it? it seems to be attached because it's rotation will change, but the actual child gameObject wont travel with the parent. is there a way to make them like, attached or something?
P.S. I have a character and when you move that character all the things attached to it move with it, like clothing, and flashlights. but when I make the flashlight a child of my unit in game it doesn't move with it. whats up with that?
Are you sure you don't have some kind of bug in your code or forgotten script that sets the position of the child game object every frame? The fact that rotation is changing but not position seems to point to that idea.
Answer by dhendrix · May 04, 2010 at 09:54 PM
Do both objects have rigidBodies? If so you could try setting the child's rigidBody to isKinematic = true.
Adding on to this, if both objects have rigidbodies and, for example, use gravity, the child position won't obey the parenting relationship, since the rigidbody overrides it.
yes, I think it was that, and I had a character controller on it when I took them both off its fine now, ah, so yes, thanks guys, I've been struggling with that for hours!
Your answer
Follow this Question
Related Questions
Make a simple tree 1 Answer
Moving parent to position of child 0 Answers
camera and positiong problems 1 Answer
How to smoothen movement of a child object? 1 Answer
Child ignoring Parent's movment 1 Answer