What is the overlap offset coordinate based on?

Discussion and feedback on Construct 2

Post » Sun Aug 19, 2012 4:19 am

Hi,

I'm wondering what the "Is overlapping at offset" coordinate is based on in Construct 2.

For instance, is it based on the coordinate of an object's hotspot? Or is it based on the edge of the bounding box from whichever side you are offsetting from?

Thanks in advance.bolosaur2012-08-19 04:26:07
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sun Aug 19, 2012 4:38 am

Quoted from the Sprite manual entry.
[quote]Is overlapping another object
Is overlapping at offset
True if any instance is overlapping any instance of another object. The collision polygons are taken in to account if set, as well as the object's size and rotation. 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.[/quote]

It does move the object according to its origin point.
Once the origin is moved, the collision polygon is moved accordingly.Kyatric2012-08-19 04:39:18
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 » Sun Aug 19, 2012 11:14 am

Thanks for the explanation.

The reason I'm asking is because I'm having a *lot* of problems with object bounding boxes colliding with each other when they really shouldn't.

For example, I have 4 16x16px boxes placed in 2 stacks next to each other on a 16x16px tiled grid.

As such:

[ ][ ]
[ ][ ]

I have an event that goes:
If box is NOT overlapping crate at offset 0,1px && If box is NOT overlapping ground tile at offset 0,1px
> Move crate self.x, self.y+1

The problem is that the top crates will NOT fall down if there is a bottom crate located in the stack next to it.

For example, in this case the top crate would fall down:

[ ]
[ ] <-- When this is destroyed, the top crate falls down.

But in this case:

[ ][ ]
    [ ] <-- Suddenly the top crates can't fall down until this bottom crate is destroyed as well.

Why is this?! The bounding boxes are set to the exact size of the objects, so that shouldn't be a problem.

It's really frustrating. :/bolosaur2012-08-19 13:19:41
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sun Aug 19, 2012 12:22 pm

[QUOTE=bolosaur]

> Move create self.x, self.y+1

[/QUOTE]

Should this be... > Move create self.y, self.y+1

Where Y is down ?
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Aug 19, 2012 12:32 pm

What do you mean by "Move create"?

And what do you mean by "self.y, self.y+1"?
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sun Aug 19, 2012 12:55 pm

[QUOTE=bolosaur] What do you mean by "Move create"?

And what do you mean by "self.y, self.y+1"?[/QUOTE]

--------------------------------
Question 1

"I have an event that goes:
If box is NOT overlapping crate at offset 0,1px && If box is NOT overlapping ground tile at offset 0,1px
> Move create self.x, self.y+1"

This is what you wrote!
----------------------------------
Question 2

You wrote "self.x, self.y+1"

Which direction are you trying to move the object X or Y.
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Aug 19, 2012 1:17 pm

Sorry, my bad. I meant to type "move CRATE." :-)

[quote]Which direction are you trying to move the object X or Y.[/quote]
Y, but I'm specifying the X position as well for the sake of clarity.
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sun Aug 19, 2012 2:30 pm

Your best bet, would be to post a link to the capx.
(I'm still using r95..if your using a more recent release somebody will
look at it)
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Aug 19, 2012 2:55 pm

I don't want to post the cap because it's for a commercial project. I don't think there's a need to do it anyway, since it's not a bug. :-)bolosaur2012-08-19 14:55:55
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sun Aug 19, 2012 7:55 pm

Try to have crates 1 pixel smaller (63X63) than the grid's cells size.
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

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests