Godot Version
godot 4
Question
I’m confused as to why this is returning the following error:
“Cannot call method ‘is_colliding’ on a null value”
func _pickUp():
if Ray.is_colliding():
var obj = Ray.get_collider();
if (obj.is_in_group("ItemPickups")):
Item = obj
Item.reparent(self, true)
Item.global_position = global_position
Item.global_rotation = global_rotation
Item.freeze = true
holding = true;
pickUpCool = pickUpCoolMax
elif (obj.is_in_group("EvidencePickups")):
if (evidence_dict.has(obj.name)):
evidence_dict[obj.name] = true
obj.queue_free()
pickUpCool = pickUpCoolMax