Ray Cast dont detect RigidBoby without geometry or solid visible?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By linuxfree
:warning: Old Version Published before Godot 3 was released.

I trying use ray cast of my player RigidBody for detect another RigidBody withou any Geometry or character visible and dont detect.

any idea?

How are you doing the raycast? Do you use the Raycast node or do you raycast from code with intersect_ray?

Zylann | 2016-09-21 12:09

I use a node parented in to my Camera and a node parented in my RigidBody Player

with a code

func check_ray_collider(): #this is for shoot detection target
    var ray = get_node("RayCast")
    if ray.is_colliding():
        
        var object = ray.get_collider()

        if object extends RigidBody or object extends StaticBody:
         
           # print("Object Collider", object.get_name())
        
            if (object.get_name() == "RigidBody 2"):
             #  get_node("/root/Spatial/RigidBody").disable()
                get_node("/root/Spatial/RigidBody/CrossHair_red").hide()
                get_node("/root/Spatial/RigidBody/CrossHair_green").show()
            elif (object.get_name() != "RigidBody 2"):           
                get_node("/root/Spatial/RigidBody/CrossHair_green").hide()
    if !ray.is_colliding():
        get_node("/root/Spatial/RigidBody/CrossHair_green").hide()
        get_node("/root/Spatial/RigidBody/CrossHair_red").show()          

linuxfree | 2016-09-21 23:10