attempt to call function get collider in base null instance on a null instance error

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By max123

I’m trying to make a bullet hole appear when I shoot a gun in my game, and I keep getting the error “attempt to call function ‘get_collision’ in base ‘null instance’ on a null instance” and I cant figure out why here is my code:if Input.is_action_just_pressed("fire"): var b = b_decal.instance() raycast.get_collider().add_child(b) b.global_transform.origin = raycast.get_collision_point() b.look_at(raycast.get_collision_point() + raycast.get_collision_normal(), Vector3.UP)

:bust_in_silhouette: Reply From: jgodfrey

Your raycast variable is null. How is it being set?