Camera angularSensibility vs. speed?

My goal is to have a “freecam” the user can comfortably fly around with and pan the camera. I am struggling to achieve desirable camera rotation control, as the camera’s speed property is heavily affecting how the camera rotates when the user pans.

In this video I attempt to demonstrate the issue.

On second thought, it doesn’t demonstrate it very well since the viewer has no idea where my mouse is :sweat_smile:

Note how on the first run, panning the camera is somewhat stable, but panning ever-so-slightly too fast causes the camera to suddenly snap seemingly multiple revolutions all at once.

On the second run, where only the speed property has been changed (from 0.5 to 50), panning the camera is slower and far less stable. It’s hard to judge how fast I’m moving the mouse, but try for yourself here: the playground roughly emulates the problem I’m having in my project.

I was under the impression that angularSensibility is the only property that should be affecting camera rotation speed, and that the speed property was solely for position changes.

I already tried setting inertia as per this post,

which did something but didn’t fix the issue; rather, it seemed to exacerbate the issue further.

I also tried following these two articles on the topic [1], [2] but I couldn’t find what I was looking for.

My hope is that someone has a ready-made freecam that builds upon the UniversalCamera, or that these are bugs (and can/will be fixed). Otherwise, perhaps I am misunderstanding what the properties do; ideally I have a “positional speed” property and a “rotational speed” property.

1 Like

Hopefully this demonstration is better.

In this example, speed is set to 50, and I’m moving the mouse at an only slightly varying speed across my desk. But there are these sudden jumps that kill any sense of consistency.

Welcome aboard!

There has been a lot of discussion about this lately.

I’ll let @georgie respond, but please be patient as most of the team members are currently on vacation.

1 Like

Here I move my mouse around with 500 DPI (Logitech G502), speed set to 5, and angularSensibility set to 5000. Observe how the rotation speed seems almost ‘bracketed,’ as if there is some mouse movement threshold at which panning the camera suddenly gets way more sensitive.

You have to pay close attention, but play with it yourself and you’ll doubtless feel the inconsistency. It’s very uncomfortable and my hope is that this behavior is easily customizable; however, the articles on this seem quite technical (see the [1], [2] links in the OP).

Thanks for reporting! The team is back in office today and will take a look :slight_smile:

Hi @gmf thanks for reporting. I believe the threshold you are experiencing is a result of the below code – where we clamp inertia to 0 if the cameraDirection or cameraRotation are less than the speedepsilon. So with a high angular sensibility (5000 in your playground) we are dividing any mouse movement with a high number, which makes intertia clamp to 0 most of the time. The moments where u experience flinging are a result of inertia not clamping to 0-- because there is enough movement in the mouse to keep you above the speedepsilon threshold.

Question is whether or not you want inertia at all. If you do not, you can set inertia to 0 and then you should experience more consistent movement, tweaking angular sensibility to achieve more sensitivity.

What did you witness when setting inertia to 0?

Also please note we are in discsussions internally about simplifying the way camera input system controls speed / inputs.

1 Like

Hi @georgie, thank you for the detailed response :slight_smile:

I’ve found a comfortable setting with these properties:

camera.angularSensibility = 3000;
camera.speed = 1.4;
camera.inertia = 0.8;

At 0.95 inertia, the bracketed movement threshold feels much lower (so, easier to reproduce the inconsistency). Setting inertia to zero makes the camera feel stiff, but this setting improves it:

camera.angularSensibility = 1000;
camera.speed = 5;
camera.inertia = 0;

Still, I like the smoothing effect that >=0 inertia gives. But I will most likely settle for inertia=0 for consistency’s sake.

I’m not qualified to propose an alternative approach, but I am excited to hear more about improvements to the camera system :grin:

For me, setting inertia to 0 did not fix the problem (see my linked post, inertia was set to 0 for a first person shooter type game).

@gmf if you want inertial effect (which i agree adds smoothing) you would want to tweak the angularsensitivity to be much lower and increase the speed and/or epsilon values so that inertia clamping limits happens far less frequently (as it is only meant to stop inertia after the decay factor causes the speed to get low enough). The problem with the original values was not intertia existing, but the fact that movement/angularSensitivity was often smaller than speed*epsilon with minor mouse movements

@Censor if experiencing similar issue, try tweaking the above as well (assuming you do in fact want inertia!)

I tried some different settings, setting inertia to 0.1 seems to help a bit. But unfortunately the issue keeps appearing from time to time. Also, shouldn’t inertia be off for an FPS? I don’t want any smoothing when I’m looking around/aiming…?