I have a platform 2D game with mechanism where the player can hide inside closet, under the bed ect. I set a global variable
var playerHidden = false, if the player hides the flag will change for
During the hidden state, I need to turn off collisions Player-Enemy. And then turn it on again. How can I do it via code?
i tryed on my "Player"
$CollisionShape2D.disabled = true but it makes more bugs :(
I set a collisions layers and masks, but I dont know how to change them via code...
During "hidden state" I use hide() and then show() for my player, when I turn on debug-show colisions, the colisions are not visible during hide() but there are still there coz the enemy is colliding with the player...
Main question: how to change collision mask/layer via code?
Please help :) please note that Im a total newbie.