Lethn After a bit of tweaking, I got a working function! Here it is:
func create_bullethole(r):
var b = bullethole.instantiate()
r.get_collider().add_child(b)
b.global_transform.origin = r.get_collision_point()
if r.get_collision_normal() == Vector3(0,1,0):
b.look_at(r.get_collision_point() + r.get_collision_normal(), Vector3.RIGHT)
elif r.get_collision_normal() == Vector3(0,-1,0):
b.look_at(r.get_collision_point() + r.get_collision_normal(), Vector3.RIGHT)
else:
b.look_at(r.get_collision_point() + r.get_collision_normal())
(variable r represents the hitscan raycast)
I did end up leaving the bullet holes as children of the collided object because in my game bullet holes are also created on physics bodies able to move, and making them children of the root caused the hole to not stay on the object.