Min and max zoom distance not zooming player out

I’m trying to make the players camera zoom out when they ragdoll so it doesn’t break my viewmodel, but it only works the first time I toggle it and then I have to manually zoom out for it to work. I have tried using a serverscript and a localscript and they both have the same result. Here is an example:

https://gyazo.com/c9e9bc5cf09f6a2fdec61a2a3320d0cd

Ignore the floating character, thats what happens when I ragdoll with the first person viewmodel, I have to manually zoom out with my mouse wheel for it to actually zoom out, but I want it to be automatic.

Here is the part that changes the characters zoom:

	if ragdollState == "Ragdoll" then
		char.RagdollTrigger.Value = true
		plr.CameraMode = Enum.CameraMode.Classic
		plr.CameraMinZoomDistance = 20
		plr.CameraMaxZoomDistance = 20
	elseif ragdollState == "UnRagdoll" then
		char.RagdollTrigger.Value = false
		plr.CameraMode = Enum.CameraMode.LockFirstPerson
		plr.CameraMinZoomDistance = 0.5
		plr.CameraMaxZoomDistance = 0.5
	end
end)
1 Like

I think you made a mistake :

if ragdollState == "Ragdoll" then
		char.RagdollTrigger.Value = true
		plr.CameraMode = Enum.CameraMode.Classic
        plr.CameraMaxZoomDistance = 20
		plr.CameraMinZoomDistance = 20
	elseif ragdollState == "UnRagdoll" then
		char.RagdollTrigger.Value = false
		plr.CameraMode = Enum.CameraMode.LockFirstPerson
		plr.CameraMinZoomDistance = 0.5
		plr.CameraMaxZoomDistance = 0.5
	end
end)

Have a nice day ! :yum:

1 Like

This doesn’t really solve my problem at all, it still just doesn’t work half the time. I still have to zoom out manually most of the time, and always on the first time ragdolling.

Is there another part of this script that sets the cameramode back to first person after the ragdoll event?

No, I had to fix this issue by tweening the camera min and max zoom. Thanks for trying to help

1 Like