playMaker

Author Topic: Send event to spawned object issue  (Read 1565 times)

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Send event to spawned object issue
« on: May 08, 2021, 04:28:15 AM »
Unity 2018.4.31
v1.9.1.f7p5

While trying to fix a bug, I've discovered that Playmaker doesn't behave as I expected. With this kind of logic



I expect that object will be spawned and will receive event in a single frame, but it receives event only on a next frame after spawn. Is this a bug?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Send event to spawned object issue
« Reply #1 on: May 08, 2021, 07:14:32 AM »
Hi.
Try setting you state as a sequence (right click empty space in action window to select), or place the send event in the next state.

Creating things is slow so it might be the issue.

When a state is not in sequence it will start all actions from top to bottom,
But it will not wait until they are finished.

In sequence it will wait for the previous action to finish before starting the next one.

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Send event to spawned object issue
« Reply #2 on: May 10, 2021, 06:04:13 AM »
Seems like I've found a bug. I did what you've said. And as you see this fsm didn't received event, but when I open script that sent it and then get back to fsm that should receive event, whiteout unpausing the game. Event gets received.

« Last Edit: May 10, 2021, 06:09:01 AM by Gua »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Send event to spawned object issue
« Reply #3 on: May 10, 2021, 09:23:51 AM »
Hi.
If you Do this without a breakpoint?

does it receive the event?

from this video it seems like breakpoint itself has some issue, as the game is paused and i don't think it should be stopped on state 2 (on the main camera fsm) , but you can see the arrow is active going to state 5.

I do have this on PM1.9.0 as well in some cases and when i set a extra state with a breakpoint it stops there.

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Send event to spawned object issue
« Reply #4 on: May 11, 2021, 02:17:38 AM »
Hi.
If you Do this without a breakpoint?

does it receive the event?

from this video it seems like breakpoint itself has some issue, as the game is paused and i don't think it should be stopped on state 2 (on the main camera fsm) , but you can see the arrow is active going to state 5.

I do have this on PM1.9.0 as well in some cases and when i set a extra state with a breakpoint it stops there.
Without break point it works fine. So it seems that additional finished step helped. Thanks for the help and additional explenation!
« Last Edit: May 11, 2021, 02:27:04 AM by Gua »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Send event to spawned object issue
« Reply #5 on: May 11, 2021, 07:49:51 AM »
np.
I think breakpoint has issues with "slow" actions.

Like 'Create' i also have it with Data makers xml actions.