|
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
(comments are locked)
|
|
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. try
or...
Alternatively you could:
(comments are locked)
|
|
You haven't declared explosion1 as a variable at the top of your script. You need this:
(comments are locked)
|
