How come accuracy changes on fullscreen mode?

When I am making my fps game and test the game in a small window the accuracy for the bullets is the way I want it, but when I do change the screen to fullscreen or different size the accuracy for the bullets is off. I am sure this common thing can anyone tell how to fix this please.:slight_smile:


232204--8432--$screen_shot_2009_12_06_at_80937_pm_193.png

Well, rendering more pixels would lower the framerate so the bullets would be moving more per frame and could therefore move through a wall without the physics engine noticing. I usually use a raycast check between the last position and the current position after movement for fast moving objects to see if anything would have been hit since the last frame.

I just wanted to reiterate this issue, as I’m having it too.

Is it really an issue of frames per second? That seems unreasonable to me…

It probably is the FPS…

When playing my game inside of the editor on pretty much full screen, the accuracy is perfect. When playing the executable on windowed mode, 1024x768, the accuracy is not so good. Takes 7 or 8 clicks for it to register the hit.

The FPS doesn’t drop below 600 so I can’t imagine how that is the problem…

The problem is with “sync to VBL”. In windowed mode, my FPS are locked to 60 which is what my monitor refresh rate is. Accuracy is perfect.

In fullscreen mode, the FPS are locked to 75. This is where the accuracy is worse.

So what could cause the v-sync caps to be different between fullscreen and windowed mode?

Is there any way where I can have the bullet shoot from where the crosshair is?

I’m interested in a solution to this issue as well since I am sure I will run into it… any ideas?

Try using Camera.ScreenPointToRay with the crosshair’s coordinates. This will give you a straight line passing through the crosshair which you can then use for a raycast or get a position using Ray.GetPoint.

Please post the relevant script. Without seeing the code that handles the shooting of bullets, there’s really no way of saying why frame rate might affect accuracy. I can’t think of any good reason why it should, unless you’re doing some sort of ballistics simulation.

Also, please reduce the size of your screen shots, or use thumbnails. Wide screen shots make the forum more difficult to read.

X-Developer, if it is indeed the Frames Per Second that seems to be changing your accuracy, make sure you aren’t calling the Raycast from a FixedUpdate() function.

Call it in the Update function

Firing bullets in FixedUpdate() will make them more regular than doing so in Update(). Neither callback should have any effect on accuracy.

Again, seeing the script in question would help people analyse this problem.