New Animation on replaced object?

Sorry, I’m hitting the forum with a lot of stupid questions which i usually figure out down the track… but here goes anyway.

Ok, the torpedo collides with the ship, the ship receives damage and the wrecked ship model replaces it with a particle system and an animation of it sinking attached.

The wrecked ship prefab works fine except it replaces in the same spot for all the prefab ships in the scene.Of course if you have only one ship it works ok.

Do I have to make 5 instances of the wrecked ship prefab all with different animation files?

M

Hmm, this should work fine if you’re Instantiating the wrecked ship GameObject using Transforms…

Instantiate (myWreckedShip, transform.position, transform.rotation);

Hope that helps… maybe I’m missing something though.

cmd+d in the project window will duplicate your prefabs. Is your ship located at the origin?

Oh wait now I get it, in the scene window, create an empty game object at your ship position, parent ship to it, (break prefab) then drag that back on the prefab in project view.
Your animation has originally recorded its transform position relative to the origin.By parenting to an empty, it becomes localised, and you should be able to use that one prefab for all wreckages…
AC

anTENNa trEE

…where is Providence RI?

OK, will look at that thanks. I am only just at the threshold of knowing what I want scripts to do and been stuffing around for too long not be able to make sense of them.

Targos

Cool, that sounds like the non-script solution. Yeah the animation is at 0, and at transform.

Thanks.

M

Ouch, we get enough grief from other states already, RI (Rhode Island) is the smallest state in the US. Providence is the capital city. We’re the armpit of New England :wink:

… thought at least it must be within the US.

Armpit? Surely you don’t feel stuck there?

M