Problem with changing camera position script

Hello, So I got a script that’s not working I have checked the output and it comes up with no errors.
What I need it to do is that when a “ProximityPrompt” is trigged move the players camera to a part and not let them go 360* around the part with there camera.
All I need at the moment is that when the player triggers it there camera is moved if you could help me with my other problem then many thanks.

Here is my script.

local trigger = script.Parent.ProximityPrompt

local Camera = game.Workspace.CurrentCamera

local Player = game.Players.LocalPlayer

trigger.Triggered:Connect(function()

Camera.CameraType = “Scriptable”

Camera.CFrame = game.Workspace[“CameraPrt1”].CFrame

end)

Local scripts don’t run in workspace.
You usually place them under PlayerGui, StarterPlayerScripts, or StarterCharacterScripts.

Also, it’s Enum.CameraType.Scriptable, not just "Scriptable"

Insert a normal Script inside of the part with the ProximityPrompt.


local trigger = script.Parent.ProximityPrompt

local Camera = workspace.CurrentCamera

local Player = game.Players.LocalPlayer

local event = game.ReplicatedStorage.RemoteEvent

trigger.Triggered:Connect(function(plr)
	event:FireClient(plr)
end)

make a RemoteEvent in ReplicatedStorage

Insert a LocalScript in StarterGui



local Camera = workspace.CurrentCamera

local Player = game.Players.LocalPlayer

local event = game.ReplicatedStorage.RemoteEvent

event.OnClientEvent:Connect(function(plr)
	
	Camera.CameraType = Enum.CameraType.Scriptable
	
	Camera.CFrame = workspace.CameraPrt1.CFrame
end)

1 Like