This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote
func spawn_bullet_hole():
var new_bullet_hole = bullet_hole.instance()
new_bullet_hole.translation = aimcast.get_collision_point()

var surface_dir_up = Vector3(0,1,0)
var surface_dir_down = Vector3(0,-1,0)

if aimcast.get_collision_normal() == surface_dir_up:
    new_bullet_hole.look_at(aimcast.get_collision_point() + aimcast.get_collision_normal(), Vector3.RIGHT)
if aimcast.get_collision_normal() == surface_dir_down:
    new_bullet_hole.look_at(aimcast.get_collision_point() + aimcast.get_collision_normal(), Vector3.RIGHT)
    new_bullet_hole.look_at(aimcast.get_collision_point() + aimcast.get_collision_normal(), Vector3.DOWN)

Hello! I've been trying to get bullet holes to work in Godot, and Garbaj's bullet hole tutorial didn't work for me:
(but if no one answers this I'll try his tutorial again), so I followed another tutorial:

And it works! Kind of... It only works on the ground. Even when I duplicate the ground and rotate it to be a wall it didn't work, and when I changed the script and rewrote it from the tutorial, but shooting at walls doesn't work.
Also the environment is made up of MeshInstance nodes with Trimesh Static Bodies.

Also it doesn't give me any errors, it just doesn't show the mesh when I shoot at walls.

I can give more code if you need it, but thanks for any help!
:D :)

Godot version 3.5.1.stable
in Engine by (57 points)

1 Answer

+1 vote
Best answer

Hii ,
i think you should try Boxshape in CollisionShape (and then resize it to nearly mesh size) instead of using automatic " trimesh " option because trimesh sometimes donot detect collisions.

by (46 points)
selected by

Oh, okay! I'll try that soon and see if it works.
That would make sense though,
as I never really did exactly what the
tutorials did with making the environment.
Thanks for answering!

That worked, thanks so much. It was driving me crazy seeing humongous lines on the walls where I shot instead of a tiny dot.
You wouldn't think it would be that hard to do, but I guess that's just part of game development.

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 Frequently asked questions and 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 [email protected] with your username.