I'm trying to make an arrow projectile, so when the arrow hits a collider, the collider becomes its parent (so that the arrow will move with the collider, and it will look like it's embedded in it). The only problem is that sometimes when the arrow is made a child it gets distorted and stretches/skews in very strange ways.
Is there anything that I can do about this? I know that sometimes objects behave strangely when made children, but not how to fix/avoid it.
P.S. the arrow is a rigidbody but I make it kinematic on collision, and the target is currently a cube
If its a case of non-uniform scaling you could use an empty game object as the parent to the collider. So instead of moving the collider, you now move the parent. You still check collisions through the collider, but when attaching the arrow, you attach it to the empty game object instead.
This means your collider can have non-uniform scaling, but your arrow wont inherit it as its no longer parented directly to it.
Just confirmed this is still a bug in Unity 2017.3.1f1
Not saving and restoring localScale of a child object of an object with skewed scale, causes really bizarre behaviour. It looks like the child object’s scale is tweaked by the inverse of the parent’s scale squeue. My parent object scale was skewed in only one axis and all my children where stretched along the same axis.
but saving the local scale and restoring it does not exactly fix the problem. Local Scale shows up in the editor as the original scale of the object, but the objects are now all the same absolute dimension (meaning parent and child are the same width, even though the child prefabs where much wider).