How do I get proper player damage kickback?

Get help using Construct 2

Post » Tue Sep 01, 2015 12:12 pm

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?
B
42
S
11
G
1
Posts: 264
Reputation: 3,299

Post » Tue Sep 01, 2015 12:20 pm

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.
B
10
S
2
G
1
Posts: 51
Reputation: 761

Post » Tue Sep 01, 2015 3:50 pm

@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!
B
42
S
11
G
1
Posts: 264
Reputation: 3,299

Post » Tue Sep 01, 2015 8:02 pm

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
B
9
S
3
Posts: 104
Reputation: 1,033


Return to How do I....?

Who is online

Users browsing this forum: dand, mageekm, oosyrag and 30 guests