S i’ve browsed the forums a little, watched a lot of youtube videos suggesting how to do this, but i can’t figure out how to create a dodge roll that works for me. I’ve tried using timelien’s with lerps, i’ve tried just using a ‘move component to’ on my character’s capsule component and I’ve tried using 'launch. I’ve found that all have worked fairly well after a bit of tweaking until you try and dodge off a height, at which point everything falls apart and you either float in mid air until it’s done then fall, or you launch for miles.
i was wondering what the best way to account for gravity mid roll would be. i’m very new to timelines and how they work but i assume it’s something to do with that.
Do you have the roll animation?
I’d say you just move your character as if he were standing on the ground, and use the roll/dodge animation, even if it looks like he’s leaping and no longer touches the ground.
And you can use a timeline to change the velocity accordingly, let’s say it’s 1000 at the moment the character jumps, and then slows down to the default movement value. You may even try disabling input until the roll is over.
i don’t actually have an animation for it yet no. i’m just not happy with it looking like he’s floating in mid air.
I know i could use animation blueprints to make him roll only when he lands, but how would i go about checking when he’s in the air instead of on the ground. and surely I could use that to just give the player some downward momentum when he’s left solid flooring.
If you create a rolling animation and make the mesh actually move in your 3D editor, there’s an option to anchor the capsule component to one of the bones during the animation (I don’t really remember what it’s called). So if your amination organically moves the mesh, you’ll be able to simply select that option in the animation, and the engine will calculate the movement for you. Maybe it will be easier this way than figuring out the movement and creating the animation later, because I’m 99% sure that the movement you have created won’t match the animation.
The only issue with that is i don’t have any licensing for animation softwares and i have no clue how to animate 3d models really, i’m only doing this as a hobby at the moment
Launch is a good way if you want to take gravity into account. You probably want to increase the ‘Gravity Scale’ on your pawn to fall faster because the default setting feels floaty. That’s just how it is in UE4. Although since you’re increasing the Gravity on your player character, other things will get affected as well such as Jump. In which case, you might want to increase your Jump Velocity to offset that stronger gravity.
Other way is using an animation with Root Motion. This means it will automatically move your character based on the animation. But you might not want this as this ignores the gravity.
yeah i think the root motion is what the other guy was trying to say. I hadn’t thought about changing the gravity though, thats really helpful. I’ll mess around with the numbers and see what I get thank you