Test if something is collidING

Get help using Construct 2

Post » Thu Aug 30, 2012 10:50 pm

I feel somewhat silly not being able to find this, the closest thread I found was this; http://www.scirra.com/forum/invert-collision_topic46284.html

Basically I have a character that paces back and forth. I need them to stop pacing when the player gets in their way. I only see On collision, is overlapping and is overlapping at offset options. But I need to test if the character is colliding with the player. It doesn't overlap though. What're my options?
B
49
S
18
G
7
Posts: 429
Reputation: 8,888

Post » Thu Aug 30, 2012 11:11 pm

I was sort of confused about this at first.

Think of it like this:

'On collision' is exactly the same condition as 'Is overlapping', with the exception that it will only trigger once.

If anything is overlapping, it has collided. Think of a collision as the beginning of an overlap.

Therefore, I would say that overlap is what you want (I'd actually look at 'overlap at offset').
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Fri Aug 31, 2012 2:34 am

I thought that might be the case, they should change the title of that event. However this still doesn't give the desired result, I tried character overlapping player and vise versa. All collision boxes for all animations is a 4 point square. To make it more noticeable I made the action destroy the player. So is C2's collision detection really bad, or am I doing something wrong?

https://dl.dropbox.com/u/44188718/index.html
B
49
S
18
G
7
Posts: 429
Reputation: 8,888

Post » Fri Aug 31, 2012 2:50 am

yeah, sqiddster is right. Is colliding would be the same as current Is overlapping, but they are only test conditions without any actions.
If you want sprite to stop or bounce, or whatever you have to code it manually.
So it's probably something wrong with your events.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Aug 31, 2012 8:15 pm

I'm well aware of that, but my point is, as shown in the example, the collision seems quite off... Is there a solution to that.
B
49
S
18
G
7
Posts: 429
Reputation: 8,888

Post » Fri Aug 31, 2012 8:47 pm

I think the 8-direction engine is pushing you back before you have a change for testing collision. Either add an invisible detector sprite with a bigger collision area, or use 'overlapping at offset'.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Fri Aug 31, 2012 9:58 pm

Thank you all for your help, I had forgotten that the visual player is not actually what the player controls but an invisible controller which collision are based on. Whoops!
B
49
S
18
G
7
Posts: 429
Reputation: 8,888


Return to How do I....?

Who is online

Users browsing this forum: agittm and 17 guests