playMaker

Author Topic: PlayMaker 1.8.5 LateUpdate handling change  (Read 544 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12196
  • Official Playmaker Support
    • View Profile
PlayMaker 1.8.5 LateUpdate handling change
« on: August 10, 2017, 11:22:25 PM »
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: [Select]
        public override void OnPreprocess()
        {
           Fsm.HandleLateUpdate = true;
        }

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: [Select]
#if PLAYMAKER_1_8_5_OR_NEWER
Fsm.HandleLateUpdate = true;
#endif

- 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
« Last Edit: August 10, 2017, 11:33:16 PM by jeanfabre »