I'm having an issue with collision layers.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By OiKeTTLe

I’m trying to make a dash that also disables collisions with walls, so you go through them. In the tileset I’ve made, the walls are on the wall layer (int 0 in collision_layer), and the ground is on int 1. The player is on both layers.
When the dash is activated, int 0 is set to false, so the player goes through the walls, which works as intended. However, the player also goes through the floor, which is a huge issue.

I’ve already made sure that int 1 also isn’t being disabled. Why does the player still go through it? Help is appreciated.

Nevermind, turns out the tilemap’s collisions override the collisions I’ve already set. Is there any way I can avoid using two separate tile sets?

OiKeTTLe | 2021-09-21 03:42

:bust_in_silhouette: Reply From: DaddyMonster

Put the floor and the wall on different layers. Say, wall on 0 and floor on 1. Set the player mask to 0 and 1. When you want to dash through walls, disable the player mask on 0. If you want to hit walls again, reenable 0.

Hope that helps.