Godot Version
Godot 4.4.1
Question
Suddenly, the raycast3D for my pistol stop working, making it no longer do damage, well sometimes it does, but rarely, I was using a plugin call DeepRaycast3D, the code for my shotgun and automatic rifle were similar to the pistol, but in the pistol it didn’t work, so I decide to use Godot built in raycast, and that also didn’t work, I tried to do a lot of things, like changing the code in the function that handles the damage to the enemy, move the code from the function to where the fire is handled itself, etc. But nothing works, then, I decided to use a print outside the if statement, and This is what most of the time prints:
<Object#null>
I don’t know what else to do.
Here is the code that handles the detection and damage.
if %raycast_1.is_colliding():
print("damage_1")
var use_RAYCAST = raycast3D.get_collider()
if use_RAYCAST.is_in_group("enemies"):
BOSS_1.damage_FUNC(pistol_RESOURCE.damage_AMOUNT)