CoreScript mouse panning code hardcodes screen resolution/aspect ratio

https://github.com/ROBLOX/Core-Scripts/blob/master/PlayerScripts/PlayerScriptsPlace/StarterPlayer/StarterPlayerScripts/CameraScript/RootCamera.rbxmx#L244

Used like this:

https://github.com/ROBLOX/Core-Scripts/blob/master/PlayerScripts/PlayerScriptsPlace/StarterPlayer/StarterPlayerScripts/CameraScript/RootCamera.rbxmx#L684

Why are either of these based on screen aspect ratio?

1 Like

I just read this script a couple days ago in PlayerScripts.CameraScript.RootCamera from Play Solo. I thought it was strange that there were hardcoded values there. I think MouseTranslationToAngle and ScreenTranslationToAngle should just be the same function.

also, how are these angles?

Looks fine to me. Camera panning speed should be consistent across different monitor aspect ratios.

ConvexHero, always asking the bigger questions. :happy1:

I’ve noticed that the camera control script defines a TOUCH_SENSITIVITY vec2 that is more sensitive in X than in Y (clearly by design), which is probably why its hard to tell that the angle ultimately calculated from the thetas returned from this function are (sometimes) wrong.