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’
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)
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.