i want to limit my framerate to 60 fps.
i use:
Application.targetFrameRate = 60;
but its wierd…
i make a test scenen with a rotating cube:
transform.Rotate(Vector3.up * 3);
and the cam+mouselook.
IF i move my mouse it starts to rotate much faster.
if i dont touch my mouse its normal and @ 60 fps.
im using the FPScount script fom the wiki.
and this is happening if im starting the .exe
so how does Application.targetFrameRate work?
does it work?
Never rely on your application running at a particular frame rate. You can target it all you want but at the end of the day you have little to no control over how many cpu cycles the operating system will actually assign to you process.
To make sure the movement isn’t frame rate dependent, simply multiply by Time.deltaTime each frame.
eg
If you really need the limit to 60fps, you should check the “Sync to VBL” check box in the Quality settings for the application. This will sync the frame rate to the refresh rate of the monitor, which is generally 60Hz on LCD monitors, however this number will improve over time, and is also a lot higher on CRT monitors.