Topic was automatically imported from the old Question2Answer platform.
Asked By
lavaduder
Old Version
Published before Godot 3 was released.
I have a animationplayer node that swaps the collisionshape2D animations, but I don’t want the collision shape to be active while the animations are not playing.
I was wondering if there was a way to disable the collision detection in CollisionShape2D. When I mean collision detection I don’t mean it as a trigger like set_trigger(false) that can still be set off. I mean to turn it off completely, and have it enabled again when desired. so queue_free() is also out of the question.
Areas can just set off monitoring and monitored status or turn off both layer and masks, the current behavior is kind of buggy (they seem to look for layers and masks instead of masks only, and react when not monitoring but are monitored).
Btw, I’m talking about the CollisionObject here (the parent), not the CollisionShape node because it is just a helper that uses the same shape resource as the parent.
If setting it to a different layer/mask will stop it from interacting with all objects/other collisionshapes, but keep it’s animations intact, then yes. Tell me how to send it to a different layer/mask.
By the way I’m using Godot 2.1.3
lavaduder | 2017-04-26 08:05
Basically, layers are where the bodies are (detected) and mask where they look for other bodies.
The “bit” ones refer to the checkboxes you see on the inspector, the other uses an int but as binary (because is easier to operate multiple flags with bitwise operations).