hey there, I’m trying to make a simple knowback effect for my enemies in the damage section of my BP. I have managed to do it adding velocity, but ofc it doesnt follow the direction of my gun. How can i make so the direction the velocity follows my foward vector? (or maybe invert the one from the enemy) Thx a lot!
Usually for impulse/dash i like to use AddImpulse. To calculate the direction you can subtract vectors. If you want an actor in the location A being impulsed towards location B, then you just need to subtract B by A (B-A) and plug into AddImpulse. Make sure to check “Velocity change”, otherwise you will probably need to have a big scale in the vector. Also, if you want only the direction, make sure to normalize the vector after the subtraction. Then, to control the force of the impulse you can multiply the result by a float.
Thanks Ill try that, sorry im so bad at vector math!