playMaker

Author Topic: Prefabs (create object)  (Read 3750 times)

bngames

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 4
Prefabs (create object)
« 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?


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Prefabs (create object)
« Reply #1 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?

bngames

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 4
Re: Prefabs (create object)
« Reply #2 on: April 24, 2011, 01:57:50 PM »
Sorry worked it out, then iTween animation had not stopped so could not destroy.