So I’m trying to make something that if you enter a zone it locks your camera into a part but I’m getting an error, how do I fix it?
local Zone_LookAtKetchup = workspace.Zone_LookAtKetchup
local ketchupcframelookat = workspace.KetchupCFrameLookAt
local localplayer = game:GetService("Players").LocalPlayer
local character = localplayer.Character or localplayer.CharacterAdded:Wait()
local TweenService = game:GetService("TweenService")
local currentcamera = workspace.CurrentCamera
local zoneketchup = zoneplus.new(Zone_LookAtKetchup)
local lookAt = currentcamera.CFrame:PointToWorldSpace(Vector3.new(0, 0, -3)):Lerp(ketchupcframelookat.Position, .1)
enteredketchupzone = false
zoneketchup.localPlayerEntered:Connect(function()
if not enteredketchupzone then
enteredketchupzone = true
print("Player Entered ZoneKetchup")
currentcamera.CFrame = CFrame.lookAt(currentcamera, lookAt)
end
end)