0 votes
asked in General Help by
Has anyone has experience using Puppetmaster with Update() rather than FixedUpdate().  We have been trying to get away from FixedUpdate in our code (for a variety of reasons, but mainly because at lower framerates in development, fixedupdate starts to cause physics death spiral.  We've been able to largely get away from FixedUpdate doing most of the simulation portion of physics for ourselves).  I'd like to move PuppetMaster over to the same paradigm, but am curious if anyone else has experience here.

1 Answer

0 votes
answered by (15.5k points)
Hey,

Thing is, it needs to run in FixedUpdate because it calculates the target positions for the joints and that only needs to be done before each PhysX step. Doing it in Update would just increase the calculations when there are frames between fixed frames.

Also, PuppetMaster doesn't just run in FixedUpdate. Although I'd like there to be something like PuppetMaster.Simulate(), there can't, because Animation runs at it's own time, PhysX runs at it's own time and frequency and PuppetMaster must do stuff like read the animation and feed it into the physics in between, so therefore it's update cycle is also cut up to pieces. Normally PuppetMaster reads the pose in LateUpdate, after the animation, then in FixedUpdate it feeds it to the physics. If your Animator is in Animate Physics mode, it will update the Animator, read the pose and feed it to the physics in FixedUpdate and disable the Animator so it would not be updated again within the physics step. It is messy, but the only way (that I can think of) this kind of stuff can be done universally with the way Unity is built.
commented by
Thanks for the answer.  My problem is that when running < 60fps (which is the normal physx update time), then when framerate starts to get low, then there are multiple calls to FixedUpdate() which in turn can slow down things further, resulting in potentially more fixedupdate calls.  This issue is something about Unity that stinks, but it's the way it is.  I've been trying to manage Physics.Simulate myself at my own delta time, which works great, but the puppetmaster stuff is still FixedUpdate() which run at 60hz.  

So my concern is about the opposite of what you initially mentioned.  Multiple fixedupdate calls per frame (and not multiple frames in between fixedupdate).  I'd have to think about the flow that you mention above.  Ultimately I may not fully understand the dependencies here, but feel like there must be a way to work with Time.deltaTime and not necessarily on fixed time.
commented by (15.5k points)
Hey,

Ok, I see..

I have a solution for you. Please send me a mail to support@root-motion.com with your invoice number so I could send you the latest.

Best,

Pärtel

Welcome to RootMotion Q&A, where you can ask questions and receive answers from the developer of Final IK and PuppetMaster and other members of the community.

Post as a guest, create an account or login via Facebook.

Please use the correct category when you post your questions.

...