Camera rotation speed changes depending on framerate

Necka

New member
Hello,

I'm sorry if this question was already asked, I did search before.

I'm having an issue that is hopefully simple enough to reproduce.
I'm using UTPC
My test scene is simple, I took the Nolan from the demo scene and put it in an empty scene with just a plane.

Added game manager and adventure camera from the wizard and hit play. It works fine.
Now I just created a simple script where I limit my fps to 60, 120 or unlimited (I get around 900 fps in that case)

Well the problem is simple:

When fps are capped at 60 I move the mouse around and the rotation is at a speed X
At 120 the rotation becomes a bit slower

When FPS are uncapped you have to move the mouse 10 times more to achieve the same rotation.

So I already experienced this issue in the past with Adventure Creator advanced 3rd person camera. I told the dev and he fixed it. He told me that something in the camera script was not framerate dependent (or the other way around.. sorry, not an expert here) and he managed to fix it.

I didn't see any configuration on the camera to change the way it gets updated.

I know it's always better to cap the frame rate for many reasons. But many different rigs, different screens, well you can have a player with a 240hz screen that will run at that frame rate...

Oh, one thing I noticed though: I could not get this issue in Editor as Unity keep having V-sync "on" despite that I disabled it in the quality settings and in Nvidia panel. Those tests were made in a build and I'd advise you to try also in a build to reproduce the problem

I hope a fix is possible :) I usually use Cinemachine and I could use the integration for it. But to be honest your Camera system is really solid and I'd prefer to stick to it

Thank you
 
Are you using FixedUpdate or Update? If you are not capping the framerate you should set your character to FixedUpdate and it'll be more consistent. You can change this on the Ultimate Character Locomotion component.
I could not get this issue in Editor as Unity keep having V-sync "on" despite that I disabled it in the quality settings and in Nvidia panel. Those tests were made in a build and I'd advise you to try also in a build to reproduce the problem
That sounds like a Unity issue - I'd report it to them.
 
Are you using FixedUpdate or Update? If you are not capping the framerate you should set your character to FixedUpdate and it'll be more consistent. You can change this on the Ultimate Character Locomotion component.

Hello Justin,

I actually changed the character locomotion update mode first. So yes my test where with the character in FixedUpdate mode.

But I don't think it has any influence at all, I could bet you can have a componentless cube instead of the character that the Camera will still behave the same with a slower rotation speed the higher the framerate is. It really is like the problem I faced before with another asset

Could you reproduce the issue in a build?
 
I can reproduce the issue if I don't set a target framerate and have the update location set to update. If however I set it to fixed update then it is not framerate dependent and is instead based on the fixed timestep.
 
It's also worth noting that Unity's play mode in-editor is not very reliable for testing this kind of thing. As you already found out, it doesn't seem to respect vsync settings (although I think if you manually set QualitySettings.vSyncCount during runtime it does), but the same also goes for capping frame rate.
 
I can reproduce the issue if I don't set a target framerate and have the update location set to update. If however I set it to fixed update then it is not framerate dependent and is instead based on the fixed timestep.
I just tested again and my results are the same as yesterday, FixedUpdate or Update don't change the problem. I will make a quick video to show it

It's also worth noting that Unity's play mode in-editor is not very reliable for testing this kind of thing. As you already found out, it doesn't seem to respect vsync settings (although I think if you manually set QualitySettings.vSyncCount during runtime it does), but the same also goes for capping frame rate.

Yes, I know and that's why I run my tests in builds. But actually this morning I figured out how to have the Vsync working properly in Editor (was actually a problem from my Nvidia settings per application, so completely my fault)

In Editor I also make sure to do this kind of tests in full screen mode as the Editor painting takes a lot of resources.
 
I can reproduce the issue if I don't set a target framerate and have the update location set to update. If however I set it to fixed update then it is not framerate dependent and is instead based on the fixed timestep.

Here is a video showing the issue:
Result is the same in build or editor mode. And the same if I use Update or Fixed Update on the character

I'm using the latest TPC version from the store (downloaded yesterday)
Unity 2020.3.9

I didn't change any setting in Unity, it's a fresh project
Times are default:
1622195790181.png
 
Hm, this does seem to be related to vsync and a potential bug. Thanks for bringing it up, will pass on to Justin and get back to you soon.
 
Top