Disabling collisions for an individual object

Get help using Construct 2

Post » Mon Apr 01, 2013 3:48 pm

I have two object types: Object A and Object B, both with a Physics behavior.
I have copies of Object A in one layout, but I want to disable only the collisions with an Object B but in one of the copies of Object A, not all of them, or globally. Using the Enable/Disable Collisions in the category Physics: Global Settings disables the collisions with Object B in all of the copies of Object A, and I just want to disable them in one of the copies of Object A.

Is there a way to individually change this?
B
3
Posts: 14
Reputation: 328

Post » Mon Apr 01, 2013 9:27 pm

sigh, while Box2d does support collision filtering. The C2 plugin does not. I know it's been mentioned as a request, but the implementation might be a little while.

"Filtering
Collision filtering allows you to prevent collision between fixtures. For example, say you make a character that rides a bicycle. You want the bicycle to collide with the terrain and the character to collide with the terrain, but you don't want the character to collide with the bicycle (because they must overlap). Box2D supports such collision filtering using categories and groups.

Box2D supports 16 collision categories. For each fixture you can specify which category it belongs to. You also specify what other categories this fixture can collide with. For example, you could specify in a multiplayer game that all players don't collide with each other and monsters don't collide with each other, but players and monsters should collide. This is done with masking bits. For example:"

http://www.box2d.org/manual.html#_Toc258082970


I would like it because it would allow an easier mdoel to do physics jumthru.jayderyu2013-04-01 21:39:09
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Tue Apr 02, 2013 12:13 am

Thanks for the advice! I'll consider it.
B
3
Posts: 14
Reputation: 328

Post » Tue Apr 02, 2013 12:18 am

What about throw in an instance var and have a custom condition to filter? Slightly messy but possible option.

Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076


Return to How do I....?

Who is online

Users browsing this forum: michaelverdi and 26 guests