Camera Zoom Distance Randomly Resetting

Just recently in our game Eat Slimes to Grow HUGE - Roblox the camera zoom has began to randomly zoom around without any explanation.

We set the players CameraMaxZoomDistance and CameraMinZoomDistance to a value that ensures the players camera stays a good distance away from the players blob.

This is the code that edits the players zoom distance everytime their size changes, when the player attempts to zoom out they are zoomed back in to the minimum distance.

if Player == LocalPlayer then
	local TrueSizeValue = GetTrueSize(Player)

	local SquaredValue = math.log(math.abs(TrueSizeValue), SizeDecrease)+1
	local Min, Max = SquaredValue + 10, SquaredValue + 60

	LocalPlayer.CameraMinZoomDistance = Compatibility.Is('Controller') and (Max - 1) or Min
	LocalPlayer.CameraMaxZoomDistance = Max
end

Thanks for the report! We’ll follow up when we have an update for you.

Hi!
I have a hunch based on your video that the dollars and icons have physics collision and thus block LOS. Is that possible?
E.g. every time the camera pops (see PopperCam.lua), a new set of icons fly through the center as well…

These are UI icons, not physical objects so this shouldn’t be causing an issue. On top of that this issue has never happened before and only started happening recently.

Do you ever see this happening without icons flying around on screen?
I couldn’t reproduce the issue in your production version.

Yes this issue happens in the game regardless of if there is UI icons visible or not. I’m on mac if that helps at all.

I’m having the same issue and noticed multiple games do so too.

Here is how you reproduce the issue:

It has something to do with setting Max and Min camera zoom distance through code. In my game, I’ve set MinCameraZoomDistance to 6 if the player has visible UI on screen. This worked until recently, as you guys have probably changed how camera works?

If I zoom my camera out and change the value of Max or Min through code, it forces this glitch to happen.

I haven’t changed my code so I know it isn’t an issue on my end.

TL;DR - Let’s say my camera distance is 64, through code I change MaxCameraZoomDistance or MinCameraZoomDistance to 6 and the game will switch my camera to 6 instantly, zooming in or out through client through scroll wheel or keyboard will switch my camera to last known distance + the slight zoom in/out I’ve done through my scroll wheel or keyboard.

How to fix:
Revert the changes you have done with how setting Max & Min distance works (it should not snap the camera to that distance if we set the Min & Max value.)

1 Like

Yea that’s exactly it, pretty much what I said in the post.

Hi there! Thanks for the report. This should now be fixed. Changing Min/Max zoom distance should not reset the camera zoom. Please let us now if you find any other issues.

Yes this is now fixed. Thank you.