How Solid Behavior works with enclosing spaces.

  • Let's say I am making some top down game. Let's also say I am making a circular room that I want to be solid and keep the player from going outside of it. Can I make a large graphic in the shape of a circle, place the player inside of it, and have it contain that player? I have tried this, and the player warps outside the bounds of the circle graphic. I assume this is because the collision detection senses this as a collision, even if the central area is empty and so is the corresponding alpha channel. If this is the case, what is the best way to create my circular room and have collision detection work correctly?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have your circular image with no solid behavior. Then add invisible solid sprites and put them around the edges of the walls. If you add the solid behavior to an object, the inner part of the collision polygon is solid, not the outside.

  • I was afraid of that. Thanks!

  • It sounds like you have the collision polygon covering the whole image. You need to change it to only cover the outer edge by having both outer and inner boundaries on it.

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