How do I have an object ignore a specific solid?

0 favourites
  • 5 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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!

  • 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

    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.

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)