Raycast collision error

Godot 4.1.1

raycast when it stops detecting a collision gives me this error
The problem is that the raycast detects the player’s collision but must detect the other collisions so that it does not transfer the objects. The issue is that when it collides with collectible objects and then one picks up the object in question it gives me an error

What’s the error? Have you tried putting the objects into separate groups and then have the raycast run an if statement to see if it’s colliding with one of the objects in those groups?

The error is when the player collects a collectible object that is attached to a movable object, an error appears because the movable object detects the collision of the collectible object and when it is eliminated it throws the following error "identifier not declared in the curred scope

So it only runs when you queue_free the object when you pick it up? What if you did something like:

If collectable object!= Null:
#run your logic here in the raycast

It didn’t work, the solution was to place the name of the raycast followed by an and and then the name of the raycast.is_in_group()

1 Like