Page 1 of 1

How do I get proper player damage kickback?

PostPosted: Tue Sep 01, 2015 12:12 pm
by bclikesyou
Looking to get proper player kickback when taking damage. I've got the flash to work properly. I just want the player to pop up in the air about 20-30 pixels. Thought I had a good solution until I got hit by an enemy bullet near a ceiling and it pushed me through, ignoring the collision.

Image
GIF of issue in action.

Image
Code. That highlighted bit is what is wrong. I know it's wrong. What can I replace it with?

Re: How do I get proper player damage kickback?

PostPosted: Tue Sep 01, 2015 12:20 pm
by Borgi
You have got teleported into the ground which is solid :)

One solution could be:
You could disable player input for a short duration of time and make your character jump.
Even set jump strength/gravity to different from the standard one you use otherwise.

Re: How do I get proper player damage kickback?

PostPosted: Tue Sep 01, 2015 3:50 pm
by bclikesyou
@Borgi Having the player jump (maybe .5 of the actual jump strength) is a solution I'm considering. Thought I'd post to see if there were any other/better solutions. Thanks!

Re: How do I get proper player damage kickback?

PostPosted: Tue Sep 01, 2015 8:02 pm
by Frostein
You could add physics behavior to the character. Disable it on start of layout. Then when the projectile hits, enable and apply force towards position