[SOLVED]Reset detect collision

Get help using Construct 2

Post » Mon Dec 31, 2012 9:11 am

I had problem with the collision between my player and a monster. Using "on collision with... " my player take damage in the first contact, but if I leave the player over the monster, the player don't take more damage unless I separate him and make it collide again. There is a form of trigger the collision every tick?

And I'm new here. The program is the most easy and intuitive I ever seen. Really fun at end of the day!

EDIT: I forgot say it, sorry: the monster had the "SOLID" behaviour. The hero the platform one.gabrign2013-01-11 18:24:31
B
11
S
2
Posts: 21
Reputation: 1,171

Post » Mon Dec 31, 2012 9:21 am

What you want is the condition "Is overlapping another object".

The rule for conditions in C2 is those with green arrows are triggered only once when they occur, whereas those without arrows are triggered perpetually while that condition is true (you can also modify that with the system condition "Trigger once while true").

Welcome to the forums! I'm also pretty new here but am already finding it to be a very informative place.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Mon Dec 31, 2012 9:37 am

If Player is Overlaping Monster
System Every tick(Or Every X Seconds)
    Player.life - 1
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Mon Dec 31, 2012 9:38 am

Wow, so fast reply! The tip about the green arrow is so useful, thanks.

The "Is overlapping ... " not work for this situation because the monster ( I forgot say it, sorry) had the "SOLID" behaviour. The hero the platform one. So must be another solution...
B
11
S
2
Posts: 21
Reputation: 1,171

Post » Mon Dec 31, 2012 9:57 am

Well: My first idea for one solution: "Put an zone around the player using overlapping for the monsters, lava pits, spikes..." but if somebody had a better one, please say it!

And thanks for the welcome GeometriX
B
11
S
2
Posts: 21
Reputation: 1,171

Post » Mon Dec 31, 2012 1:59 pm

There is also an "Overlapping at offset" condition. You could add this in and say "If at 4 or -4" to check a few pixels to the left or right. This way when the player runs into the solid you are actually checking a few pixels past the payer.

More info on this in the manual
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Tue Jan 01, 2013 4:20 pm

Boolean, I didn't notice that condition, really useful, thanks you!
B
11
S
2
Posts: 21
Reputation: 1,171


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests