How do i make a perfect 'dodge' ability like ff15

I want to make an ability that makes me immune to attacks if i press it at the right time it before i get hit it will move away reposition and maybe slow motion etc. Also how would i make it appear on screen like ‘press R to dodge’

https://www.youtube.com/watch?v=qvvM91aAXhw @ 0:43

how would i make something like this having a tough time with this.

This should be just a check when you are being hit, if you were ‘dodging’ or not, and just call some function to do the pretty stuff like reposition, slow-mo, play animation. When you press a button, you set yourself as ‘dodging’ and after may be a delay you automatically need to set dodging to false. (e.g 0.5s)

how do i do the check when im getting hit, tried line trace by channel
could you explain further abit more

thanks for the answer

It might help explaining/showing what you already did.
That way we wont have to repeat what you already did, and can build upon your work, instead of explaining from scratch.

sorry about that I haven’t done much just trying to make ai do no dmg when i dodge but idk just testing random stuff no luck so far

ohh ok done, how do i take no dmg now

You character should have a CapculeComponent, use it, to check if something hit you, and whether you were dodging at that moment.