Launch Character in opposite direction of hit

I have a game based on pvp spells that can be launched from different locations. I’m trying to have a knockback effect when hit by a spell. I set it up this way but close combat spells creates a different (longer) knockback then farthest spell. What am I doing wrong?

KnockBack

1 Like

You can always draw a debug arrow visualizing the unit direction to see how does it looks for different attacks.

Usually in this kind of effects I like to calculate only XY plane direction, then add some pitch by hand. The launch character (and physics in general) is very dependant on the friction with ground so I like to have more control over it.

1 Like

The length of the vector is the velocity.

You’ll want to normalize the vector, and then multiply it with a configurable value (variable) that is the “knockback velocity” of the effect, and use that as the launch velocity.

2 Likes

For future reference to anyone:

1 Like