3 ms·
I'm working on the bullet system for a game right now and another advantage of hitscan I think, that wasn't explicitly mentioned in the article, is that you can
by keyP 7y ago
I'm working on the bullet system for a game right now and another advantage of hitscan I think, that wasn't explicitly mentioned in the article, is that you can get objects behind objects to then determine if the first object should absorb some of the bullet damage. For example, an enemy behind a wall may still damage but not as much as if the shots were fired directly at the player.
When you send out the raycast and get a list of all objects hit, you can iterate over the objects hit and reduce damage value until the first enemy object is hit (pending any distance restrictions).
- meheleventyone 7y agoYou can do that when simulating each bullets trajectory as well. For example straightforward setup for collision detection would be a raycast per bullet per tick and as such can work much the same way.
- keyP 7y agoIndeed you can, but the idea is that a raycast is still needed. I should've been more specific in that it doesn't mean the projectile system can't do it but the idea of raycasting allows for that additional advantage cheaply and easily.
- meheleventyone 7y agoYeah the key differentiator is a trade off between cost and simulation fidelity.
- Narishma 7y agoIt is mentioned in the article, with the example of Quake's railgun.