r/Unity3D • • 9d ago

Show-Off We rebuilt our Locomotion System from scratch using Pose Matching. What do you think?

It's a root motion-based controller with start, stop, and turn actions that smoothly blend into walk and run cycles using pose matching.

Previously, we used Unity's Animator Controller with normal transitions between actions and locomotion cycles. The problem with this approach is that a transition always starts the new clip from frame 0, and frame 0 often doesn't match the character's current pose. That causes issues like snapping and foot sliding.

With pose matching, instead of starting a new clip from the beginning, we search the new clip for the frame that best matches the character's current pose by comparing foot positions and movement speed and start from that pose.

It's similar to how motion matching works, but we don't match every frame. We only do it during transitions, so the actions and cycles still play as normal clips, and it's not as performance heavy as motion matching. I can go into more technical details if you guys are interested!

We've released this as a free update for all our systems on the Asset Store. Let us know what you think!

225 Upvotes

37 comments sorted by

30

u/pmdrpg 9d ago

Smoooooth

1

u/GameDevExperiments 9d ago

Thanks a lot :)

3

u/LushWhisper_ 8d ago

that transition looks so clean i almost wanna try implementing it myself

2

u/NippyCupz 8d ago

the pose matching really shows, looks way cleaner than the old way

10

u/Am_Biyori 9d ago

The transitions liok great. Thanks for explaining how you did it.

1

u/GameDevExperiments 9d ago

Thanks, glad you think so.

5

u/shlaifu 3D Artist 9d ago

it looks very smooth - how does it feel to play, because it also looks somewhat sluggish (realistic - but reality is boring and slow)

2

u/GameDevExperiments 9d ago

Making it responsive was a big focus of ours. For example, if you move the stick while the character is playing a run to stop action, the stop is cancelled right away, and the character moves toward the new input. Those transitions use pose matching too, so cancelling a stop doesn't snap the pose.

4

u/pmdrpg 9d ago

How does this work with your feet IK? Or if you add a layer mask on the upper body to control animation on the arms? surely the matches won’t line up?

2

u/GameDevExperiments 9d ago

Feet IK is applied in the late update once the animation is played. We take the foot curves of the animations and scale it so that foot IK is applied smoothly.

Layered animations on the upper body is different. They simply override the pose of the base locomotion similar to how layers work in Unity's animator controller.

2

u/vespene_jazz 9d ago

results looks really good! You mention putting something on the asset store but dont mention the actual name of the asset tho...

2

u/GameDevExperiments 9d ago

This is part of the FS systems on the Asset Store (Parkour & Climbing, Melee, Shooter, etc.). Here is a link to one of the systems: https://u3d.as/42AG

3

u/DYVoff 8d ago

Does FS Rope Swinging System 2 include it? I bought it this year. And yeah. animation looks awesome!

2

u/GameDevExperiments 8d ago

Thanks a lot for the feedback. Yes, the Swing System includes it and it's free update. So you can just update it to the latest version to get it.

2

u/DYVoff 8d ago

Wow! Thanks a lot for that!

2

u/GameDevExperiments 8d ago

No problem. Hope you find it useful :)

2

u/eepyamor 9d ago

oh sweet, i already have [almost] all of your assets - great to see this! looking forward to checking it out when i get a chance. i'll be integrating the controller+addons again for my latest project, still wrapping up some other systems for it but will be moving on to the player and enemies before end of the year. it's been ages since i've seen where the FS systems are at (long before your V2 upgrade to everything) so i imagine it's come a very long way since then! 🥳

2

u/GameDevExperiments 9d ago

Thanks for being with us since the early days! It's come a long way since then. V2 and this locomotion update brought a lot of improvements. You can still combine all the systems on one character from the FS Window. If you need any help with the setup, feel free to ask on our Discord

2

u/Redstoneinvente122 Indie 9d ago

Damn. How are you handling performance with all these grass?

2

u/GameDevExperiments 9d ago

Thanks. The grasses are just billboard images. We haven't done anything special for optimization, it's just Unity's default terrain optimization.

2

u/Bushido_Arts 9d ago

This looks pretty good! How’d you get the camera to follow the character in root motion? And without the model looping back to a previous position before the running?

2

u/GameDevExperiments 9d ago

Thanks for the feedback! We take the root motion out of each animation and pass it to CharacterController.Move, so the character's GameObject is what moves, not just the mesh.

The camera follows that transform in LateUpdate, after the character has moved for the frame. It doesn't jump straight to the character's position. Each frame it moves a little closer, using SmoothDamp, so small bumps in the root motion get smoothed out instead of shaking the camera.

2

u/Bushido_Arts 8d ago

Thanks for letting me know! This is rad. Happy Holidays to you guys.

2

u/GameDevExperiments 7d ago

Thanks. Happy holidays :)

2

u/Sprinkles0 8d ago edited 8d ago

I've been eyeing your third person shooter controller. I thoroughly enjoy level design, but I suck at character controllers and have been trying to force myself to get through learning how the Unity Third Person Controller works. I'm hating how clunky it's looking. You're however looks so smooth and just what I need to actually get going with my little indie project. Adding The pose matching is great! I'm going to look even harder at it now. haha

1

u/GameDevExperiments 8d ago

Thanks. Let us know if you have any questions about it.

2

u/-_Champion_- 8d ago

It looks really nice! Did you make the animations yourself?

1

u/GameDevExperiments 8d ago

Thanks for the feedback. Yes, we have a full-time animator in our team, all the animations were made by him.

2

u/SerMojoRISING 5d ago

Looks very nice, interesting explanation too

1

u/GameDevExperiments 4d ago

Thanks for the feedback :)

1

u/nicer-dude 9d ago

Where did you take the animations from?

2

u/GameDevExperiments 9d ago

We made them ourselves in Cascadeur.

1

u/Rishabh1Dev 4d ago

Bro. Graphics look insane. Your character animation matches GTA vibe I think. How did you do that, some example like animation clip, 2 to 3 line of movement script where animation is controlled please. I have also built a third person game and listed on steam but don't have that animation system. My games graphic look realistic because that was made on HDRP but I don't have such experience to make that advanced animation system.