Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Verzatileow |
So I am trying to make a script that disables a collision box so " Node " for the player and enables another one so that they could crouch or crawl. For a 2D game.
For example a godot Script
func _physics_process(delta):
var col = get_node(“CameraPosition/Area2D/CollisionShape2D”)
col.set_disabled(true)
print(col.is_disabled())
For C# disabled does not exist, so the question is how do I disable the Node ?
Example code
2 Colliders : StandingCollison" Which is defaulted to true as in enabled and " CrouchCollision" which is disabled “False”
if (Input.IsActionPressed(“ui_down”) && (on_ground == true)){
var node = GetNode(“StandingCollison”);
As far as I have searched I cannot figure this out, and throughout multiple forums that Godot has provided this has not been listed for C#.
The Colliders should Get disabled when A button is pressed and another one gets enabled, and when its pressed again it would then do the reverse, I want to know how to disable it…