Isolating a layer for collision.

Get help using Construct 2

Post » Sun Feb 09, 2014 5:42 pm

Is there a built in way to isolate a layer in terms of what objects can collide? That is to say, maybe the player picks up an item that is normally on one layer where it could collide with some things. Then the player picks it up and it's now hanging out in the players inventory, and it's been moved to the GUI layer. Now lets say part of the player inventory sorting system relies on collision/overlap detection, but you only want to pay attention to overlaps that occur on the GUI layer. In the meantime, there are other objects like the one in inventory bouncing around in other layers, but you want those ignored. Now, one further condition: all these objects are part of the same family, and the tests have to be done for the family, not the individual family members. (I'm not going to write separate scripts for each and every type of inventory item).
I realize that some filtering can be done by checking which layer an object is on, but I am wondering specifically if there is some setting or built in method of preventing objects on one layer from colliding with objects on another. If there is, it would greatly simplify what I'm doing.
B
11
S
4
G
1
Posts: 159
Reputation: 1,803

Post » Sun Feb 09, 2014 9:14 pm

@Yttermayn, there's not, but using overlap detection to sort something seems a bit redundant, special reason why? if you change that, there's not really a problem, just disable collisions if family on layer

in other case, just make two conditions, family is on hud layer and family is on object layer and put the collision in subevent
ImageImage
B
69
S
21
G
7
Posts: 827
Reputation: 10,017


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests