Attention | Topic was automatically imported from the old Question2Answer platform. | |
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!