My collision layers are being reset when I run the game

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

I have this enemy scene that is a kinematic body 2d. I am setting the collision layer and mask but it gets reset to 0, 0 when I run the game. Any ideas why this might be occurring? I’m inheriting from a parent scene called enemy and the collision shape is on that scene.

How are you instancing the enemy?

A112Studio | 2020-05-09 15:21

I instance it before the scene is run. I’m not instancing it dynamically. It’s a child of the level node, which is just a node 2d.

Kaan Alpar | 2020-05-09 16:18

:bust_in_silhouette: Reply From: Kaan Alpar

I couldn’t get it to work from the editor so I just set the collision layer with gdscript.