- Home /
Variable walking / running speed with locomotion system
I'm working on an animation control scheme for a set of characters with the ability to blend in different emotions for different walking styles and speeds. I have a working version that I use to test it where it walks in place with a scrolling uv floor, and it works if you move the character through the world as well.
I want to use the locomotion system with the characters as a way to get rid of foot skating, and add the ability to go up stairs, walk on rough terrain etc.
So far I've just copied my control script along with the locomotion system and modified my script to be driven by the speed of the character controller. I then calculate the desired speed of the character based on a base speed and the emotions it currently has displayed.
----PROBLEM (if you dont want to read the preamble ;) )----- I speed up the movement of the character controller so my character is moving at the right speed, I also speed up the playback speed of my run and walk animations that effect the upper body. The problem is even though the character is moving faster I think the locomotion animations are playing at the same speed so it just takes larger or shorter steps. The result of this is that the upper body comes completely out of sync with the lower body and creates a very unrealistic walk cycle.
/PROBLEM
Any ideas how i can speed up the animation speed of the lower body? All of my scripts are in JS and the locomotion system is in C# i think.
Answer by syclamoth · Nov 14, 2011 at 12:02 AM
I don't understand the problem here- the locomotion system always tries to make strides of the correct length, so if your animations are not appropriate for the speed your character is moving, it will always look silly! If the walk and run animations also affect the upper body, you shouldn't be manually changing them- the locomotion system manages all of that.
Basically, if you could speed up / slow down the lower body stuff, you would be preventing the locomotion system from doing its job. You need to make some more animations for your character, that are more appropriate for the speeds you will be going at.
Also, there is absolutely nothing forcing you to use the locomotion system's inbuilt character motor. You can move your characters around however you like.
I get what your saying, and what i want to do may not be possible with the locomotion system. Basically the way I have it set up in my existing scene is that I have my 'base' speed (the optimal speed as calculated by locomotion) and then I am applying different emotions on top - ie if they are angry I apply the angry animations on top, and speed up the walking speed, if they are sad i slow it down etc. So I am modifying the playback speed of the walk and run cycle as well as how fast the character moves in the world.
Ideally I would like to be able to go to the motion group in the locomotion system and just change a .speed attribute of both my walk and run animations, but then i guess it would have to reinitialize.
as far as the character motor, I'm just using that for testing but I have another movement script that I'll be using for the final implementation.
Well, as I've said, the entire point of the locomotion system is that it automatically changes the speed of your animations to fit with the speed the character is moving. You might want to set up several different motion groups on the leg animator, and blend between those for your variants.
Ah starting to make a bit more sense for me - i just keep getting distracted with all the small details I have to worry about in my script so its hard to see the big picture.
I'll try setting up some motions groups at different speeds.
Thanks for your help, sorry it took a little while to sink in :)
Not sure if I understand completely, but the way to make the animations go faster or slower that doesn't interfere with the Locomotion System is to just actually make the character move faster/slower. Actually I can't remember if going faster than the base speed will only make him take longer steps or also speed up, but for slower than base speed I know it's using a combination where the steps become both shorter and have longer duration. But yeah, setting up more motion groups is the most flexible solution.