Hello There!
I was having the same problem, but I figured it out.
So I have the PopperCam module, and I have this custom camera code.
local function camUpdate()
cam.CameraType = Enum.CameraType.Scriptable
uis.MouseBehavior = Enum.MouseBehavior.LockCenter
if char and hrp then
local startCFrame = CFrame.new((hrp.CFrame.p + Vector3.new(0,2,0)))*CFrame.Angles(0, math.rad(xAngle), 0)*CFrame.Angles(math.rad(yAngle), 0, 0)
local cameraCFrame = startCFrame + startCFrame:VectorToWorldSpace(Vector3.new(CameraController.shoulderOffset.Position.X,CameraController.shoulderOffset.Position.Y,CameraController.shoulderOffset.Position.Z))
local cameraFocus = startCFrame + startCFrame:VectorToWorldSpace(Vector3.new(CameraController.shoulderOffset.Position.X,0,-5000000))
cam.CFrame = CFrame.new(cameraCFrame.p, cameraFocus.p)
* CFrame.Angles(CameraController.TapMag.Position,0,0)
end
end
and as you see, this does not take mesh popping into account, so I simply added
local Popper = require(Modules.PopperCam)
local function camUpdate()
cam.CameraType = Enum.CameraType.Scriptable
uis.MouseBehavior = Enum.MouseBehavior.LockCenter
if char and hrp then
local startCFrame = CFrame.new((hrp.CFrame.p + Vector3.new(0,2,0)))*CFrame.Angles(0, math.rad(xAngle), 0)*CFrame.Angles(math.rad(yAngle), 0, 0)
local cameraCFrame = startCFrame + startCFrame:VectorToWorldSpace(Vector3.new(CameraController.shoulderOffset.Position.X,CameraController.shoulderOffset.Position.Y,CameraController.shoulderOffset.Position.Z))
local cameraFocus = startCFrame + startCFrame:VectorToWorldSpace(Vector3.new(CameraController.shoulderOffset.Position.X,0,-5000000))
cam.CFrame = CFrame.new(cameraCFrame.p, cameraFocus.p)
* CFrame.Angles(CameraController.TapMag.Position,0,0)
Popper:Update()
end
end
And now it first runs my custom camera code, and then adjusts the length from the camera origin using PopperCam’s update function. Note that this code runs on RenderStep.
Enjoy!