Bug Reporting > PlayMaker Bug Reporting
Time Scale Zero and event firing [FIXED]
(1/1)
Murcho:
I've got a pause menu done in UIKit, and I'm using UnitySendMessage from the SDK side to pass event messages to a custom class which fires events on an FSM. It's working perfectly, except when I set the Time.timeScale to 0, the events don't appear to fire inside of my FSM. I know the message is making it through to Unity, as my Debug output is firing correctly. Can anyone confirm this is the case?
Alex Chouls:
Hmmm, what actions are you using? Those actions may need a "RealTime" option... in fact, thinking about it Send Event should probably have a real time option. I'll look at that for 1.1.
Murcho:
The first action on the State that should be getting fired from this event is the Scale Time action. Kind of important here :P.
Here is the other code that is firing the event :
--- Code: ---public class NativeToUnityMessageHandler : MonoBehaviour
{
public PlayMakerFSM menuLogicFSM;
DelayedEvent de;
public void ReceiveMessage(string message)
{
Debug.Log("Message : " + message);
de = new DelayedEvent(menuLogicFSM, message, 0.0f);
de.Update();
}
}
--- End code ---
It appears that calling Update on the DelayedEvent doesn't fire the event properly in the FSM with the TimeScale at 0. I can confirm that the function is getting called correctly as the Debug message is printing to the console, and that the string being sent is correct also, and matches up the the event in the FSM.
e.Ko:
DelayedEvent is indeed effected by timescale and isn't sent if the game is paused (timescale = 0).
In your example I would just send a regular event:
menuLogicFSM.Fsm.Event(message);
I'll add a realTime option to DelayedEvent to make it easier to author actions with a Real Time option...
Murcho:
Thanks for the fix. A realtime option would probably be useful for the DelayedEvent as well.
Navigation
[0] Message Index
Go to full version