Hi, so I’m looking forward for some advice on a proper way to use animations. Right now, I’m willing to make a dodging system. I have my dodging animation that can be set to static or with movements. If I’m using it as in-place, then I add the movement with a Launch Character
function, but this is not working because of the ground friction which is stopping nearly instantly the character (High ground friction value is intended as I want my character to move instantly in any direction).
On the other hand I can use my animation with movements attach to it, however by doing so, the movement is only affecting the character’s mesh, which means that both the collision capsule and the camera stay and the character goes back to its previous location whenever the animation ends.
So I’m wondering if a moving animation can override character location, and if this is a good idea to use moving animations in game ?
First you set ground friction to 0 when you launch, then set it back to whatever value you want.
The alternative is using a timeline to set actor location which gives you a lot more options for non-symmetrical movement (stepping attacks for example).
Here’s a basic launch event where you can set the variables for height and distance:
Thanks for your reply. This is roughly the script I made (except I didn’t think about changing the ground friction during the launch which may help)
However this was only an example, my question is rather about the use of in-place or root-motion animations
In circumstances where a character moves based on input from a person, rooting the animations is the way to go yes. For movies and non-interactive media that doesn’t matter, but for a game using moving animations are generally not a good idea if you intend the character to be able to generate accurate events, not to mention transitioning between animations (if you use a moving animation and you transition to an in-place animation the character will blink back to its original location).
For normal player interaction I would definitely go for rooted, but there are exceptions of course. Let’s say your character has a bounding attack for example, whereby it jumps forward, strikes the ground and then leaps back (think Revenant in Guild Wars 2). In such a case it could be beneficial to have the character capsule to stay where it is. Granted it’s not a shooting type of game where you’d want the hitbox to follow the character.
Personally I don’t use root motions because I create all my animations in place. I may use movement while finetuning it, but for animating in maya for example I use the graph editor to set the character root to 0 and stay there before importing it. Using moving animations can also cause a lot of floaty behavior where the character seems to move independently from its actual speed. This is a very difficult thing to adjust properly between different animations and will necessitate a lot of clutter in your code.
For your scenario root motion would work better, but you need to set it correctly which is difficult when you arent used to it. When you set correctly the root motion, the capsule moves with the mesh and when the movement finishes your origin moves to its correct location relative to the capsule.
I get the point. So basically you would most likely add movement – if necessary – with launches and timelines ?
I see, I’m indeed not used to root motion. I’m going to have to do some more research on this.
So in your opinion it is better to use root motion for any animations that involves character to move ?
Yeah definitely. Timelines can be tricky though, so I hope you have a nitpicky-personality! I find the results from timelines to be extraordinary though provided you are willing to put in the time it takes to adjust.
Yes, with root motion you will get you gameplay consistency. But the problem is setting it up.
Have you seen this page?
I will have a shot on this
I usually take the time needed to make things look right so it should be okay.
Well I’m gonna give a try to both methods and see which one works best for me. Thanks for your replies!