Hi!
I have recently been making a gungame, and i am struggling to make a crosshair for the guns.
When i shoot the gun, it raycasts from the camera to where the mouse, with a random spread. This spread is determined with MATH, but has a variable. In the pic below, let us say the spread is 2. That would mean it shoots at a 2 degree angle, somewhere on the circle.
(Circle is visual only, not accurate)
How can i convert the angle of which the gun shoots at, to pixels on a screen.?
The reason I want this is to adjust the crosshairs size to visualise where the bullet can go.
What i have tried so far is to manually get what the pixel size is at X degrees and then based off that scale it, the problem is if i were to scale the users FOV (such as zooming with a scope), then it doesnt work. For some reason FOV doesnt seem to have a pattern as to how it zooms the camera. Here are datapoints on what.
NOTE: These are tests using simply my eyes to see if it fits, not 100% accurate