PlayMaker News > PlayMaker Announcements
PlayMaker 1.8.5 LateUpdate handling change
(1/1)
jeanfabre:
Hi Everyone,
So this post is about release 1.8.5 onwards and how Late Update call is handled differently now for performances. It's important to read and understand this for developers who create and maintain custom actions but also for non coders if your game doesn't work as expected, it could be something to look for before going nuts :)
Now for an action to catch LateUpdate, you need to register for this inside the OnPreprocess method
--- Code: --- public override void OnPreprocess()
{
Fsm.HandleLateUpdate = true;
}
--- End code ---
Few tips:
- Don't do this on Awake() or any other methods, OnPreprocess() is the right place and the most efficient time to set this up.
- for publishers and custom actions writers that share it on the forum or on the Ecosystem, if you want your action to work across all PlayMaker versions for backward compatibility, make use of the compiler flag PLAYMAKER_1_8_5_OR_NEWER and you are sure to have your action to work for any PlayMaker versions.
--- Code: ---#if PLAYMAKER_1_8_5_OR_NEWER
Fsm.HandleLateUpdate = true;
#endif
--- End code ---
- If you create actions that let the user choose between Update, lateUpdate or fixedUpdate, make use of the FsmStateActionAdvanced class, check out FloatClampAdvanced for an example on how to use it.
If you have any doubts or questions, just get back to us :)
Bye,
Jean
Deek:
I went through my scripts searching for every instance of OnLateUpdate() to make sure they are up-to-date after this change (luckily quite easy with VS2017) and found that (unlike most PlayMaker and custom actions) the following actions aren't updated with the OnPreProcess()-prerequisite yet:
PlayMaker Actions (1.8.5):
"ArrayForEach"
Custom Actions:
"iTweenRotateUpdate2"
"TorqueLookRotation"
For the iTween one you'd need to add:
--- Code: ---public override void OnPreprocess()
{
if(updateCall == PlayMakerUpdateCallType.FixedUpdate)
{
Fsm.HandleFixedUpdate = true;
}
#if PLAYMAKER_1_8_5_OR_NEWER
if(updateCall == PlayMakerUpdateCallType.LateUpdate)
{
Fsm.HandleLateUpdate = true;
}
#endif
}
--- End code ---
For every other action the following suffices:
--- Code: ---public override void OnPreprocess()
{
#if PLAYMAKER_1_8_5_OR_NEWER
Fsm.HandleLateUpdate = true;
#endif
}
--- End code ---
You might want to delete this (my) post after updating those actions to keep this topic clean or notify me to do so.
jeanfabre:
Hi,
thanks for spotting this, this is addressed ( will be fixed in the next playmaker update, and you can redownload from the ecosystem for the other actions).
Bye,
Jean
Navigation
[0] Message Index
Go to full version