Ok, so I have a prefab, lets say it's called platform. Now I've made 2 objects on the screen using that prefab, and called them, platform1 and platform2.
My hierarchy looks like this
Now I want to trigger both explosions at the same time and I've tried the following JS script:
but for some reason, only the second platform gets triggered. Does anyone know how to fix this? Thanks in Advance, Dave
asked May 08 '11 at 02:07 PM
If I remember correctly, gameObject.Find() is not relative... It searches the entire scene, and you're probably getting the 2nd explosions both times. transform.Find() however, is.
Alternatively you could:
answered May 08 '11 at 02:30 PM
You haven't declared explosion1 as a variable at the top of your script. You need this:
answered May 08 '11 at 02:20 PM