• News

• Industries

• Learning & Support

• Community

• Marketplace

# How do you implement a DodgeRoll like Dark souls?

Hello everyone. Im trying to figure out how to implement a DodgeRoll like Dark souls or gears of war ones.

I can’t really find any tutorial, tho i found a thread on the forum with someone posting some screenshots.

I tried to make them work but now i’m just stuck with the character Moving relative to the direction of the camera.

All i want is decide the dodge direction with inputs, if im pressing D and then Dodge it should move on the right and so on.

I’m really a newbie so hope someone can help me, thanks!

Try getting the forward vector of the actual character, not the mesh. Also, you might want to disable movement, while you roll, and then re-enable it after it’s over (just movement as in forward/backward or strafing).

This isn’t quite an entry level topic, but to break it down for you, you would start but getting the direction of your stick input. Dark souls always rolls the direction you are pulling the left stick, that’s why you can still roll in any direction even when locked onto an enemy.

Dark souls then does some math to determine the distance you can roll based on your weight limit and equipped weight.

You define the end location of your roll based on this math and the left stick vector. Trigger a roll animation (this would look like the player is rolling on the spot if you saw it say in Maya). Then interpolate to the calculated location over a set time, say .5 seconds. Roll speed could be calculated or adjusted by stats too if you like.

You would trigger a bool at calculated times for dodge invincibility so tell the game if the player can be hit. This would also take certain stats into account like Dexterity or equip weight.

You would have to implement a ‘stop rolling’ function than cancels the roll lerp if you get hit outside of the invincible dodge period.

So this is a general outline of how it works in Dark Souls, I’ve simplified it a bit but should be enough to get a decent roll system up and running.

i think i would use a root motion for that,make like 8 directions of a roll,it’s good as it’s minimal coding and let’s the animation handle the movement so it can be timed correctly,for invincibility frames if you wish you could do anim notifications

A root motion roll is not really the way Dark Souls does their rolls and the OP wants a DS style roll.

Howdy

So this is what I came up with;

It uses 4 root motion animations, Roll Foward, Backward, Left and Right

And this bit of code to determine which to play, depending on the characters direction and your movement input

Whoa! Thanks everyone for the advices and everything, tomorrow i will be finally home to try it out!

I’ll let you know and thanks again!

Hey try this one:
With this u can roll/dodge when moving like Dark Souls: