0 votes

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)

in Projects by (15 points)

1 Answer

0 votes

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

by (10,690 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories