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