playMaker

Author Topic: Custom Action Coding Question  (Read 454 times)

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Custom Action Coding Question
« on: May 20, 2022, 03:17:29 AM »
I'm writing a custom action to check the bool value of a object right after it was instantiated on the network. (FishNet in this case).

The bool is for whether or not the game object is Owned by the current local player or not.

When it first spawns, that value is "False" for 1 frame or something, then becomes "True" if its true for every frame after that. 

I guess it takes a frame or so to go from its default False to True

OnEnter() always picks it up as "False" but if i add an "Every Frame" check to my action it will become "True" next frame.

How do I get OnEnter() to either way a sec or deal with the new object needing a second to set its local bool?

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Custom Action Coding Question
« Reply #1 on: May 20, 2022, 04:46:07 AM »
There's a lot of racing conditions when using Playmaker. If you're writing a custom action, you can always make on enable to wait for invoke another method with a small delay. That another method will have get bool.
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Custom Action Coding Question
« Reply #2 on: May 20, 2022, 09:38:58 AM »
Hi.
you can setup a coroutine or a await

for await you might need to set a #pragma to prevent a warning

and wait a frame, or check for some initiate completed