Player knockback

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

OK so Samuel was on the right track then. It’s not about the velocity of the other actor, it’s some kind of force-field bounce-back effect.

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

And maybe show the new blueprint code.

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

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

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!

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! =)