playMaker

Author Topic: Regarding [Next Frame Event] [SOLVED]  (Read 1031 times)

yslee

  • Playmaker Newbie
  • *
  • Posts: 2
Regarding [Next Frame Event] [SOLVED]
« on: January 13, 2020, 08:14:12 PM »
Hello,
I found that [Next Frame Event] action is very useful as following link

https://hutonggames.fogbugz.com/default.asp?W349

I understand how to use [Next Frame Event] action from PlayMaker Editor to make a [TRANSITION].
Sometimes it is necessary to trigger a [TRANSITION] from script by sending event.
If I call SendEvent() method, [TRANSITION] happens immediately on a single frame update and sometime it causes a problem.
Therefore it is necessary to [SendEvent] on NEXT FRAME from script like [NEXT FRAME EVENT] action.
I wonder if there is a way to [SendEvent] on NEXT FRAME from script like [NEXT FRAME EVENT] action.
Do I have to write some code to  [SendEvent] on NEXT FRAME from script?
I need your help.
« Last Edit: January 14, 2020, 01:03:51 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Regarding [Next Frame Event]
« Reply #1 on: January 14, 2020, 01:03:39 AM »
Hi,

 yes, you can create a one frame delay in script, but it's cumbersome indeed..

you need to use coroutines ( which means you have to be in a monobehaviour script) and yield for one frame.

more explanation below:

https://answers.unity.com/questions/755196/yield-return-null-vs-yield-return-waitforendoffram.html

Bye,

 Jean