[Solved] Make a collision for a closed map

i added collision to my map(which is supposed to be a supermarket, so a closed space) by using the separate objects action, but when i press play, it throws the character out of the map, is there a way to change the collision?

Can you post a screenshot of the events and the scene editor window?

I’m assuming the problem most likely stems from the fact that since you’re using the separate objects action when the the left mouse button is clicked, the player then gets pushed out of the map (just like how you explained in the description). I think the best way to solve this would be having a sprite/tilemap that acts like a border. You could put this object around the edges of the super market and then use collision detection to separate the player and the border object, that way the player isn’t immediately flung outside the camera view.

You might also be able to give the supermarket a custom collision mask using multiple vertices and masks to create a border, but not only is this time consuming I’ve found that it is sort of buggy, especially when it comes to the separate objects event.

You’ll also want to have a condition that actually checks for collision.

its working now, thanks man

1 Like