"On collision" and "On overlap"....

Discussion and feedback on Construct 2

Post » Tue Dec 20, 2011 4:00 am

I am trying to make a test of a platformer with physics. However I am having trouble getting the character to jump. It jumps okay when no conditions are imposed, only the "press button" one. But I need to stop the character from jumping in air. I thought I would do this by checking if it's in contact with the "ground" and if so, let it jump, however I am using the "overlap" condition to check this, which for some reason it's not working. The player it's clearly overlapping the ground, C2 for some reason does not think so. I thought I would then use "on collision" instead, but the problem persists. Is this a problem with physics?

Also, why can't I invert "On collision"? VampyricalCurse2011-12-20 04:01:42
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Tue Dec 20, 2011 8:57 am

you should add another little "sensor" sprite (without physics behaviour this time) attachet to the bottom of your main character sprite, then check for "onOverlapping" between sensor and the ground/objectsmrpink2011-12-20 08:58:35
B
5
G
2
Posts: 4
Reputation: 1,463

Post » Tue Dec 20, 2011 9:39 pm

[QUOTE=mrpink] you should add another little "sensor" sprite (without physics behaviour this time) attachet to the bottom of your main character sprite, then check for "onOverlapping" between sensor and the ground/objects[/QUOTE]

Yeah I guess so. -__- I was trying to avoid this scenario, but I guess it's the only work around. I still wonder why this is happening though.

Thanks a lot. :)
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Thu Nov 29, 2012 6:45 pm

What if you used the "Overlap at Offset" condition? You could say if player is overlapping the collision object at Y:+1.

"The 'offset' variant will test for an overlap at an offset from the first object. For example, testing for an overlap at an offset of (100, 0) will temporarily move the object to the right 100 pixels, test for the overlap, then move it back again."
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Thu Nov 29, 2012 8:51 pm

@boolean: at the time of the previous last post of this thread, the condition "overlap at offset" wasn't yet implemented in C2 (a year ago).
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Thu Nov 29, 2012 8:56 pm

what the...the post date says 2011. Why was it on the first page? 0_o

edit - I just noticed I responded to another thread that is from February. Where are all these old posts coming from? boolean2012-11-29 20:59:22
B
24
S
4
G
1
Posts: 244
Reputation: 3,462


Return to Construct 2 General

Who is online

Users browsing this forum: NetOne and 3 guests