Best way to setup tracing for hitscan weapons
I'm currently working on a multiplayer shooter and need help with line-tracing for my hitscan weapons. My current approach to doing the tracing is to:
The problem is that, this is a third person shooter, and by tracing from the camera's location, it would hit objects that are not only in front of the weapon, but also behind the player. Please see the included picture.
So my question was if this really is the best way to trace for hitscan weapons, or if there maybe is another, better way? If there is no better way, then how could I improve what I already have? (Possibly tracing from like 500 units to 10 000 units? Instead of 0-10000 units which is what I have now?
Thanks in advance :)
I've just seen a youtube video about this and this is absolutely what I'm looking for. So as I understand it, basically what a projection of a point onto a plane does is moving the point forwards and blocking out the space behind the player? Thanks alot to HarryHighDef and ZeroParadigm! :)
Follow this question
Once you sign in you will be able to subscribe for any updates here