Forum rules - please read before posting.

Syncing Animation with Teleport

I have a 3D scene where my character needs to navigate a treacherous floor. I have custom "obstacle-crossing" animations, but for them to work, I need to move him away from his origin. At the end of the animation, I use a Teleport command to match him back to his destination, but there's almost always a brief frame where I can see the end of his last animation flicker across the screen (caused by the single cycle offset between the teleport and animation actions). 

Is there way to sync the animation and teleport together? Or at least cut down the frame rate when it happens? I've gotten around it in some parts by doing a camera change, but that wouldn't look good for this scene.

Comments

  • Welcome to the community, @Datadog!

    Behaviour like this seems to be more noticeable with Unity 5.2 onwards.  I don't know if they just upped performance, but I've noticed this a couple of times in my own project.

    I'd need to see a video demonstrating this more clearly for a more complete answer, but you could try swapping the Teleport Action with the one that re-sets the animation (assuming they're placed one after the other already).

    However, if you're using Unity's root motion features, it may be possible to set the animation up such that it's already in the correct position afterwards - no need for an additional teleport.  My own game actually has a root motion-enabled variant of the player that I can swap in when needed.
  • I've tried swapping the teleport and animation reset with better results, but it still glitches at random. I think, like you said, creating a root motion variant might solve the problem.  I'm new to Unity, so the passing references I kept reading about root motion weren't clear about what it was or why to use it, but now it's starting to sink in. I'll try out a new rig tonight and see how it works out.

    And thanks for the quick reply, Chris! I've been prototyping a small game these last few months, and I may have a few more questions in the near future as I wrap it all up. :)
  • You're welcome!  I've been a fan of your work for some time, so I look forward to seeing what you've got cooking.
  • And it works! It took a fair bit of re-rigging and troubleshooting, but swapping in a Root Motion stuntman seems to do the trick! Thanks, again!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.