Player knockback

Okay I tried that now, but it’s still not working. Agh! This is ridiculous, I look like a fool right now. I don’t know, maybe I should just trash this knockback idea and just figure something out.

Yeah the enemies just walk up to you and hurt you when their hitbox touches you. That’s why I want to add knockback now and probably in the future make them play an attack animation.

I got something for you! hold your horse’s

Alright I’ll post a screenshot of my failed attempt. Gimmie a sec.

it’s really messy but here you go.

https://i.imgur.com/WZ6gZGa.png

Alright, this old blueprint of mine is no longer relevant because Samuelb’s blueprint works and I’m using that now.

Yes! Your blueprint worked. Thank you!

What does the PrintString say? It should not be all zeroes.

And maybe show the new blueprint code.

You should use the forward vector and it doesn’t need to be negated anymore (use a + multiplier). Also, add in a PrintString after the AddImpulse and give it the same impulse vector. See what is going into AddImpulse.

Samuel showed more of what I was saying about using the velocity. But if you want it so you get knocked back if you bump into a stationary enemy then you will need to at least add in more stuff. It depends on how you want the game mechanic to work.

great to hear, no problem! =)

Try something like this. This worked in the fpcharacter template with the projectile.
You have to set the projectile to block for it to work.

Edit: i Also tried running into boxes and using launch character with a “get actor forwards vector * negative value” worked aswell