Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: bngames on April 20, 2011, 12:28:22 PM

Title: Prefabs (create object)
Post by: bngames on April 20, 2011, 12:28:22 PM
When I use "Create Object" to instantiates a game prefab (gun shot) then call "Destroy Self" after collision "Trigger Event" - I get the error below:


The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.


But it's just a gun shot prefab, why cant you destroy a prefab and then create them again?

Title: Re: Prefabs (create object)
Post by: Alex Chouls on April 22, 2011, 03:12:56 AM
So the bullet prefab has an FSM with a Destroy Self action? And it successfully destroys itself? Trying to picture the setup... do you get the error with the editor closed? If possible, can you send me the scene?
Title: Re: Prefabs (create object)
Post by: bngames on April 24, 2011, 01:57:50 PM
Sorry worked it out, then iTween animation had not stopped so could not destroy.