I have StaticBody3D in my main map and I want it to collide with the player character only on certain conditions.
But when I’m enabling and disabling the collision with this line:
@export var collision_vystup: CollisionPolygon3D
collision_vystup.disabled = true
this code is in player script defined with: @export var collision_vystup: CollisionPolygon3D
and played if certain area being entered if that is somehow important
collision just stops working and even if I can see the shape I can go thru it.
Yes the collision works. But there is another thing I forgot to mention
I don’t want the collision to be active at the beginning of the game so i disable it in the ready function of the player like this:
but when I disable this line (so collision is active from the start)
then the collision is always active even if “disabled” is set to true somewhere else in the code.
Strange is that these chages seam to be reflected visualy. It shows and disappears exactly when it should but in reality it is still there and just seem to reflect the same value it started with.
For example when the collision is enabled from the start, this happens
here I am in the area where collision should work and it does as it should