My enemy runs towards ma and attacks. How would I setup a system in the mycharacter BP to lunch or add an impulse in the opposite direction of being attacked no matter which way your facing??
I can set it up to add impulse to the negative of the camera that way I shoot back but if the enemy is behind me and I get hit it still just knocks me back instead of forward.
if you subtract the attackers position from the victims position, it will give you a vector pointing from attacker to victim. then you can normalize that vector, and multiply it by the force of the attack.
I’m not 100 percent sure what you mean… how would I tell the player BP where that attach is coming from? Like how could I bring the location of the enemy into the BP?
when the attacker attacks, they can use a line trace or sphere trace to get a reference to whatever object was hit. then you can pass the location of the attacker to that reference object inside an interface function parameter.