Bullet holes not showing on MeshInstance walls?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Redical
func spawn_bullet_hole():
var new_bullet_hole = bullet_hole.instance()
aimcast.get_collider().add_child(new_bullet_hole)
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)
else:
	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!
:smiley: :slight_smile:

:bust_in_silhouette: Reply From: Rajdeep

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.

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!

Redical | 2022-12-02 02:46

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.

Redical | 2022-12-02 11:07