children objects under an animator object swapping positions by itself when one is destroyed?,object position changes in animation when another object is destroyed.
I'm a bit of a newbie in general to coding and in unity (8 months or so) so this might be something stupid i'm doing but... I'm currently making a 2d shmup and I'm working on a boss fight. This boss fight is a group of 6 ships. They are parented by an empty game object that I've put the animator on and I have a script that governs their behaviour which has been working fine for everything else in the game (and this boss except for one weird thing). I wanted to have the ships move in different attack patterns so I've made various ones using the animation dopes sheet and set an anim int parameter which is governed in code by an IEnumerator with a switch statement to pick which pattern to use. They all work fine until you destroy one of the ships. This is where it get's a bit odd. You shoot say ship A but on screen Ship C looks like it's been destroyed. No matter which one you shoot they disappear in the same order. However the explosion is being instantiated in the 'correct' place (where you shot). But when you look at the hierarchy the ship you shot (ie shipA) IS destroyed. but then ship B and C move around positions to make it look like a different ship is destroyed. What makes this more confusing to me is that the ships (in their new locations) still move correctly in the attack patterns even though (technically) it's a different ship in that position. All the child ships have a different name A, B C etc so it shouldn't be confused with the naming convention. Interestingly I did change the name of all the ships as a test (From ship1 , ship2 etc to ship A, shipB etc) and it changed the order that the ships would move around but still retained the problem. I just want to lock each ship on it's transform path's not have them swap like this. Any pointers ideas would be greatly appreiciated. I'm stumped... ,