Collision Issues. How to fix?

Get help using Construct 2

Post » Fri Jul 21, 2017 2:21 am

I have an event for each enemy that is basically as follows:
Player on collision with Enemy
----------Player Y < Enemy ------------------------------- Subtract 1 from Enemy Health

Else
----------Player is not flashing -------------------------- Flash
------------------------------------------------------------------- Subtract 1 from Player Health

I've been having this weird issue where, when the player jumps on an enemy, most of the time it works exactly like it's supposed to, but sometimes it doesn't and the player just falls right through the enemy and takes damage. I've tried to fix it myself, and every time I think I've fixed it, it comes up again. any ideas?

Any help is greatly appreciated. :mrgreen: :mrgreen: :mrgreen:
B
24
S
9
Posts: 112
Reputation: 2,010

Post » Fri Jul 21, 2017 7:25 am

Are the collision setting correct?
B
10
S
3
G
4
Posts: 21
Reputation: 2,854

Post » Fri Jul 21, 2017 11:28 pm

Johnzo wrote:Are the collision setting correct?

If you mean collisions are enabled, yes they are. I could set five enemies down, jump on four of them with no problem, but fall right through the fifth one.
B
24
S
9
Posts: 112
Reputation: 2,010

Post » Fri Jul 21, 2017 11:31 pm

Post a CAPX for help.
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Sat Jul 22, 2017 12:20 am

I wouldn't be sure then! Good luck and i hope you find an answer shortly! :D
B
10
S
3
G
4
Posts: 21
Reputation: 2,854

Post » Sat Jul 22, 2017 12:23 am

blackhornet wrote:Post a CAPX for help.

Here's a capx. Jump on the enemies and you'll see the problem.

https://www.dropbox.com/s/qf664c0oe083t ... .capx?dl=0
B
24
S
9
Posts: 112
Reputation: 2,010

Post » Sat Jul 22, 2017 1:15 am

@Aquanex2


it looks like your collision box for the enemies are quite small to use in combination with the Shine behavior so the player misses the collision with the enemies when is falling, My guess is because the enemies move up to fast because of the shine behavior and swell on collision with the player they keep still moving up there is no push back for them, so because the player is falling fast too that's why it misses the collision some times.

you can either change the enemies collision box to their full box or make the enemies solid
both of this options worked for me without a problem
B
40
S
23
G
83
Posts: 298
Reputation: 45,844

Post » Sat Jul 22, 2017 1:41 am

tarek2 wrote:@Aquanex2


it looks like your collision box for the enemies are quite small to use in combination with the Shine behavior so the player misses the collision with the enemies when is falling, My guess is because the enemies move up to fast because of the shine behavior and swell on collision with the player they keep still moving up there is no push back for them, so because the player is falling fast too that's why it misses the collision some times.

you can either change the enemies collision box to their full box or make the enemies solid
both of this options worked for me without a problem


It can still happen even if I turn off the sine behaviour as well, although it is far more infrequent.
B
24
S
9
Posts: 112
Reputation: 2,010

Post » Sat Jul 22, 2017 2:13 am

@Aquanex2

Is working ok for me here, if I add the solid behavior to the enemies and with the shine active, it didn't happen not even once, and in another test, I left it for more than 10 minutes jumping and is still jumping while I'm writing this I'm not sure what it could be in your case.
B
40
S
23
G
83
Posts: 298
Reputation: 45,844

Post » Sat Jul 22, 2017 2:20 am

tarek2 wrote:@Aquanex2

Is working ok for me here, if I add the solid behavior to the enemies and with the shine active, it didn't happen not even once, and in another test, I left it for more than 10 minutes jumping and is still jumping while I'm writing this I'm not sure what it could be in your case.

Okay, I added solid and now it's working fine, but what if I don't want the enemy to have a solid behaviour?
B
24
S
9
Posts: 112
Reputation: 2,010

Next

Return to How do I....?

Who is online

Users browsing this forum: totoe, Yahoo [Bot] and 9 guests