• Runtimes
  • Flutter - Switching skins seamlessly with physics based animation

Switching skins mid animation works fine in flutter - but I noticed that when a skin uses Physics there's a little jump in the animation for those elements / meshes that use Physics.

Eventually the animation syncs back up. I'm calling this issue a "Physics Warm Up Issue"

For example, let's say I have a hero with long blonde hair then at the touch of a button they have blue hair. Because the hair uses Physics - there's a noticeable skip when I switch skins.

Is there a work around for this? Is there like a copy current Physics state?

Thank you as always.

    Related Discussions
    ...

    The issue you're experiencing with a noticeable skip when switching skins that use physics is likely due to the physics simulation needing to "warm up" or reinitialize when the skin is changed. This can cause a temporary desynchronization in the animation. Unfortunately, there isn't a straightforward way to copy the current physics state directly when switching skins, as the physics simulation is typically reset. However, you can try to mitigate this by ensuring that the physics constraints and settings are consistent across skins, which might help reduce the noticeable jump. Additionally, you could experiment with preloading or precomputing the physics state for the new skin before the switch, though this might require custom implementation depending on your specific setup.

    PABretherton

    Can you share the code you use to change skin?
    Does your hair skin contain skin bones?

    Yeah, as Davide said, it probably depends heavily on your skeleton. If you can share it, we can try to figure out what's wrong.