playMaker

Author Topic: Destroy Gameobjects by tag doesn't work[SOLVED]  (Read 2667 times)

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Destroy Gameobjects by tag doesn't work[SOLVED]
« on: January 20, 2017, 12:11:24 PM »
Hi

Got this action, the fsm is enabled and the objects have the same tag but when it comes to this state for destroying it just gets stuck on it and nothing happens... It has finished transition but that doesn't help either... Any ideas?
« Last Edit: January 27, 2017, 01:46:24 AM by jeanfabre »

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Destroy Gameobjects by tag doesn't work
« Reply #1 on: January 23, 2017, 08:55:58 AM »
Nevermind, I gave up and I looped through all the childs and update them instead.. Probably a lot quicker and more efficient than destroying/creating anyway.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Destroy Gameobjects by tag doesn't work
« Reply #2 on: January 24, 2017, 01:51:02 AM »
Hi,

 Odd, and you haven't put any delay in the action setup?

 Bye,

 Jean

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Destroy Gameobjects by tag doesn't work
« Reply #3 on: January 24, 2017, 10:11:25 AM »
Nope...

Now I have similar problem with this action... I have 2 actions

Destroy objects by tag and then it's linked on finished to Run FSM. What is odd though is that the Run FSm seems to be started before the objects get destroyed... BUT... If I put a wait between them then it's all okay. This isn't right though and I shouldn't have to do that.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Destroy Gameobjects by tag doesn't work
« Reply #4 on: January 26, 2017, 01:42:16 AM »
Hi,

 that's a Unity thing, Objects are destroy during the frame, not instantly. It's a known "feature", so yes, wait a frame using "Next frame event" and you are good to go.

http://answers.unity3d.com/questions/18651/difference-between-destroy-and-destroyimmediate-.html


 Bye

Jean

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Destroy Gameobjects by tag doesn't work
« Reply #5 on: January 26, 2017, 05:04:41 AM »
Aaaaaahhh... Got ya thanks