In order to do a camera trick, I have a script on all my objects that creates a few clones of itself containing only a mesh and material a set distance away. These clones are attached as children to the main object- the thought is that with no scripts or ridgidbodies or anything like that on the clones, they will rely entirely on the parent / children relationship to keep in sync movement-wise. This works really well right up until the parent collides with the ground.
Upon hitting the ground, the parent object freezes it’s position to make it “stick”. This works fine for the parent, but the children all kinda freak out at this point. I’ve done some debugging on this, and it looks like the problem lies with my freeze only the position - the rotation remains unfrozen. As soon as I tell the script to freeze the parent’s rotation as well upon landing, the children all land in the correct fashion.
Also, and the reason why I kinda think this might be a unity bug (even though I hate questions that use that), is that a the amount the children move from their proper spot seems to change from one run to the next, with no script changes. Seems like that shouldn’t happen. Also also, the transform.position does not change- the numbers always look correct.
Here is a screenshot so you can see what I’m talking about. The first shot is the white child flying away from a launcher object, microseconds before impact. The white balls are tracers I added to show the flight path of the object. As you can see, it looks straight. The next slide to the right shows what happens a moment later when it lands and jumps to the right for some god-forsaken reason. Again, although the screenshot does not show it, the parent object lands correctly and does not ‘jump’.
Anybody have a clue what is going on here?