How do I have an object ignore a specific solid?

Get help using Construct 2

Post » Wed Jan 18, 2017 9:41 pm

Is there any way to have an objects collision ignore a specific solid, preferably in a way that I can turn on and off with events.

I know you can turn off collision for the object, but I need collision for other things.

I had a search, and could only find posts of people asking for this as a built in action, but no workarounds.

Thanks!
B
10
S
4
G
5
Posts: 139
Reputation: 2,983

Post » Thu Jan 19, 2017 1:08 pm

It depends on what that you're doing with those objects with regards to what behaviours and so-on they're running. There is unfortunately no ideal workaround for this AFAIK. HOWEVER: check out the Chipmunk physics port by R0j0hound

behavior-chipmunk-physics_t110815

It allows 'collision groups' which make this sort of thing easier to control. This, of course, assumes a lot: a) you're happy to install plugions, b) that you're using physics and c) that you don't need incredibly dynamic control of these 'selective collisions'.

Another option that works in some simple circumstances is to have two objects to represent each item, have one with the solid behaviour and the other can be used to collect collision data when solid is not being used. Again, not ideal in all situations.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 245
Reputation: 2,314

Post » Tue Jan 24, 2017 10:34 pm

Thanks for the reply, and sorry for the delayed response. Crazy couple of weeks.

I'm happy to install plugins, but I'm not using physics, mostly platform behaviours.

Using two objects could work, I'll have a play.

It would definitely be great to have the ability to choose to turn collision off with certain objects. IIRC, you could in Multimedia Fusion, though haven't used that in years.
B
10
S
4
G
5
Posts: 139
Reputation: 2,983

Post » Wed Jan 25, 2017 7:00 pm

You could turn it off with a first subevent in the event block for the object, do whatever picking/collision condition in the next sub-event and re-enable the solid behaviour in the 3rd sub-event. If done within the same event block this should have no impact on other events.

I used a similar solution for a tilemap with multiple z-levels when I needed to do fog-of-war. Seemed to work.
B
15
S
6
Posts: 85
Reputation: 1,195

Post » Wed Jan 25, 2017 9:36 pm

I ended up just using positioning to determine collision rather than actual collision.

If I ever need it again though, I'll definitely try the subevent method. Sounds like it could work well.

Thanks everyone!
B
10
S
4
G
5
Posts: 139
Reputation: 2,983


Return to How do I....?

Who is online

Users browsing this forum: danalog and 29 guests