Hello all,
I am doing a topdown 2D game, and i have seemed to gotten to a spot I don't know where to go. I want to be able to attack the enemy and have the hit do a slight knockback. But I can not seem to figure out how to determine the angle I am at from the enemy and continue it to knock the enemy backwards. I tried Youtube, but nothing quite worked for me. I think I have the majority of the theory down if i can just figure out a way to determine where the player is in relation to the enemy, If i can find the angle based in a vector2 i think i can just force the enemy in the same direction and it would work.
Can someone point me in the direction of how to determine on the fly what angle the player is from the enemy in a vector2?
Thank you for any help!
Randor73