Collision is constant with Transparent areas of collision layer

kruzekruze Member Posts: 8
I have created an overlay which is to be used as a collision layer however I'm finding that it's being continually marked as "collided with" although I know the player sprite is within the transparent area of the layer.

Very much like a boundary wall for the screen although it's irregular in shape. Any idea what might be causing this? I haven't tried bringing layers to the front or back yet.

First night with GS so inevitable I'd hit some wall excuse the pun :-)

Comments

  • GamersRejoiceGamersRejoice Member Posts: 817
    You need to have the collision shape be the same as your graphic. Currently you can only have a rectangle or circular collision detection. If your shape that you want to collide is irregular you'll need to make an actor that acts as your collision wall and place it over your other actor and set the visibility to 0
  • kruzekruze Member Posts: 8
    I have created the collision layer as an actor (full screen actor) which surrounds the path that I want the ball player to move along. The transparent areas are obviously where the path is so the player won't immediately be classed as hitting the collision layer. I've also left half the ball size gap around the path so the ball can be half on the edge of the pathway without it hitting the collision layer as this would be true of the ball in a real world environment. Having done this the ball is still being classed as having hit the collision layer even though the ball sits in a transparent area of the collision layer.

    I have not put the collision layer as the very top layer I think the ball player is on the top layer but given the transparency I wouldn't have thought this would make any difference so long as both the ball and collision layer were next to each other. I have also set the collision layer as non-visible obviously so it does not show to the player

    I will endeavour to dabble some more but just found it strange that it would be classed as having hit the layer when the ball is definitely sitting within a transparent area.

    Any help would be appreciated still.

    TIA.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi kruze, you are correct that layer order makes no difference to the collision detection.

    As GamersRejoice said, currently you can only have rectangle or circular collision detection and please note, this would include any transparency around the actor as well. Although if you have a ball as a player, providing you've done the following, you'll have good collision detection on the ball:

    Make sure that the ball is to the limit of the square size, i.e if your ball actor is 64 x 64 pxls, ensure that the ball goes right up to the 4 middle edges, with a diameter of 64 pxls (and it's a PNG with transparency)

    In the actor's Actor Editor window, under Physics, select Circle as your Collision shape

    As to the path, if it's straight, then make sure your clear collision shapes are (based on the 64 pxl example), 32 pixels away from the edge of the path.

    If your path is winding, make up the transparent collision areas as much smaller areas, and much more of them, to place 32 pxls away from the curves.

    hope that's helped (if you haven't solved your probs already!)

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • magic101himagic101hi Member Posts: 713
    WE NEED PNG WRAP

    -Josh

    p.s. I like CAPS
  • kruzekruze Member Posts: 8
    Thanks for the info guys, I'm all sorted now :)
Sign In or Register to comment.