Multiple colliders for on sprite

  • I'm wondering what the easisest way of adding more colliders to the same sprite is. Because I need the sprite to have a bigger collider when colliding with a specific type of object.

    I guess I need to create an other sprite and pin it to my object? I've tried that but when I attached it to my main sprite the main sprite stopped acting like an instance and all sprites with pinned collider sprides acted the same.

    I would really appreciate an example of how to do this while preserving all sprites as instances :)

  • What do you mean by "stopped acting like an instance"?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The "main objects" where moving around randomly. And when the collider that is pinned to the objects collides with an other object the "main object" which the collider is attached to is supposed to change direction.

    But when I tried this all "main objects" changed direction.

    I can maybe create a simple project showing my problem and upload it.

  • Ah, I see what you mean now. Your problem here is that when the "Collision" objects collide with each other, the "Collision" objects are the ones being picked.

    You want to pick the "Main" object and apply events only to that.

    In order to solve your problem you'll need to track which "Collision" object is connected to which "Main" object.

    One way would be an instance variable to store the collision UID:

    PickingCollision.capx

  • Thank you very much!

    That's exactly what I was looking for! :)

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