hey! im getting an issue where i try to pass the players camera through a function to a module but it doesn’t seem to go through. I keep getting this error:
" 21:15:28.349 Unable to cast value to Object - Client - openModule:15"
Lines of Error:
local cameraTween = tweenService:Create(camera, twi, {FieldOfView = inFov})
and
openModule.openShop(frame, currentCamera, normalSize)
– client
openEvent.OnClientEvent:Connect(function()
if isDebounced then return end
isDebounced = true
local currentCamera = workspace.Camera
if currentCamera then
openModule.openShop(frame, currentCamera, normalSize)
else
warn("CurrentCamera is nil")
end
wait(0.5)
isDebounced = false
end)
– module
function openNpcShop:openShop(frame, camera, openSize)
local openSizeTween = tweenService:Create(frame, frameTwi, {Size = openSize})
local cameraTween = tweenService:Create(camera, twi, {FieldOfView = inFov})
frame.Visible = true
openSizeTween:Play()
cameraTween:Play()
shopBlur.Enabled = true
end
any help is appreciated!!