This process sounds just very heavy and complicated. I imagine the first mesh that is hit by the bullet will take the hit? Unless your bullet can go through some materials, changing its range, velocity and the damage taken (which would make it a bit more complex).
I believe what @Cedric means with using rays is that when you aim and shoot your bullet from a distance, the ray cast from the source in the direction of aiming catches the first mesh that will be hit by the bullet. When the bullet reaches this point (hit), it is detected and makes for the impact (animation) and damage taken (game state). That’s it, that’s all. Else, You could also have a look at yuka
Here’s a link for an FPS demo:
https://yuka.babylonjs.xyz/js/playground/hideAndSeek/
2 Likes