0 votes

I've noticed that RayCast2D collides with CollisionShape2D even if the latter is disabled. I'm wondering if this is a bug.

To reproduce this, create a scene with the following structure:

Node
    > RayCast2D
    > StaticBody2D
        >> CollisionShape2D

On CollisionShape2D, set disabled to true.

Add this script to your RayCast2D:

extends RayCast2D

func _process(delta):
    print(is_colliding())

Notice is_colliding() returns true despite the collision shape being disabled.

Is this a bug or intended behavior?

in Engine by (1,577 points)
edited by

I seem to be having the same problem. Did you find a solution?

1 Answer

+2 votes
Best answer

Is a bug, see https://github.com/godotengine/godot/issues/12685

Probably fixed by https://github.com/godotengine/godot/pull/17151
Not sure if was already added or not to 3.0 but is on master (cherry pick tag).

by (7,898 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.