Yo, its xg here,
So quick rundown of what I’m trying to do,
Essentially upon function, I want for the camera to tween to a position and is shown as working in the example.
But as shown, upon trying to active said function in first person, it doesn’t change the camera’s Cframe.
I’ve tried setting the CameraMode
to Classic to try and zoom out and failed.
In the above example I’m setting the player.CameraMinZoomDistance
to a value above 0.5, but as shown, is not zooming the player out.
Code linked:
function InventoryOpen()
if not debounces.Inventory then
storedValues.DefaultCam = cam.CFrame
controls:Disable()
debounces.Inventory = true
cam.CameraType = Enum.CameraType.Custom
player.CameraMinZoomDistance = 5
if cam.CameraSubject == nil then
repeat rs.RenderStepped:Wait() until cam.CameraSubject ~= nil
end
cam.CameraType = Enum.CameraType.Scriptable
local newCam = asts.CamPart:Clone()
newCam.Parent = workspace
local hrp = character.HumanoidRootPart.CFrame
newCam.CFrame = CFrame.lookAt(hrp * (CFrame.new(0,0,-7)).p, (hrp * CFrame.new(-3,0,0)).p)
ts:Create(cam, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = newCam.CFrame}):Play()
wait(0.5)
asts.UIPart.UI.Enabled = true
events["CamPan"] = CamPan()
else
if (events["CamPan"]) then
events["CamPan"]:Disconnect()
end
cam.CameraType = Enum.CameraType.Custom
player.CameraMinZoomDistance = 0.5
ts:Create(cam, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = storedValues.DefaultCam}):Play()
storedValues.DefaultCam = nil
wait(0.2)
controls:Enable()
debounces.Inventory = false
end
end
Appreciate any form of assistance
Cheers, XG.