How do I ignore transparent part for collisions textures?

0 favourites
  • 5 posts
From the Asset Store
Ambient Atmospheric Nature Music Inspired By Planet Earth
  • Hey!

    I already checked if it was asked before, but didn't find anything not old about that.

    For my RPG Game, I'm using a big picture with all my collisions square to detect where the player can go or not.

    Problem is, it seems that the collision is not detected by the texture itself, but by the all picture, even the transparency area.

    Is it possible to ignore the alpha part and having the collision only when a sprite overlap the texture itself?

    Don't know if i'm clear so here is my collides pictures :

    Thanks a lot!

  • I think the best way would be to use a Tilemap. You could use invisible tiles or set the whole Tilemap invisible.

    Other Sprites collide only with the tiles not with the Tilemap itself.

  • You're right, I could totally use TileMap, but I was curious to know if there is some tricks to manage that... would have been really usefull in my opinion!

    Nevermind, thanks a lot for your help :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not sure if this is what you mean, but you can turn off the collision checks on individual tilemap images. So in 1 tile map you can have different collisions depending on the image selected.

  • If you have many maps like that, you can probably create a system which will paste the map sprite on a canvas, read canvas pixels to detect transparent areas and build a tilemap automatically. But this will be a difficult task.

    For one map I would just create a tilemap by hand.

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