This is probably an easy one, but I don’t wee how to call FixedUpdate or LateUpdate on a custom task. ActionTask appears to only have OnUpdate. I see static methods AddFixedUpdateMethod and AddLateUpdateMethod in MonoManager, but I don’t see them being called anywhere. Any thoughts on how to use FixedUpdate in an custom task?
ActionTasks only get an Update callback for performance while FixedUpdate or LateUpdate callbacks should be manually registered if need so.
Here is example of how to do that:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
usingUnityEngine;
usingNodeCanvas.Framework;
usingParadoxNotion.Design;
usingParadoxNotion.Services;
namespaceNodeCanvas.Tasks.Actions{
publicclassFixedUpdateExample:ActionTask{
protectedoverridevoidOnExecute(){
MonoManager.current.onFixedUpdate+=OnFixedUpdate;
}
protectedoverridevoidOnStop(){
MonoManager.current.onFixedUpdate-=OnFixedUpdate;
}
voidOnFixedUpdate(){
Debug.Log("FixedUpdate");
EndAction();
}
}
}
Let me know if that works for you.
Thanks!
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.