I’m trying to make it where if you touch a part your camera gets changed to the CFrame of another part (if you know what I’m saying)
I don’t know how to make it work, it only works for me in StarterCharacterScripts.
I changed it to work only when a part is touched and it failed.
So in total, you touch a part and the camera is changed to the CFrame of a part.
I also made both of them in a LocalScript
local Player = game:GetService("Players").LocalPlayer
local HumanoidRootPart = Player.Character:FindFirstChild("HumanoidRootPart")
local Humanoid = Player.Character:WaitForChild("Humanoid")
local Camera = game.Workspace.Camera
local Player = game.Players.LocalPlayer
local CamPart = game.Workspace:WaitForChild("ArcadeCamPart")
script.Parent.Touched:Connect(function()
repeat wait() until Player.Character
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace.ArcadeCamPart.CFrame
script.Parent.Parent.Enabled = true
end)
That’s the improvised script I thought of (whenever you touch a part)
local Player = game:GetService("Players").LocalPlayer
local HumanoidRootPart = Player.Character:FindFirstChild("HumanoidRootPart")
local Humanoid = Player.Character:WaitForChild("Humanoid")
local Camera = game.Workspace.Camera
local Player = game.Players.LocalPlayer
local CamPart = game.Workspace:WaitForChild("ArcadeCamPart")
repeat wait() until Player.Character
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace.ArcadeCamPart.CFrame
script.Parent.Parent.Enabled = true
That’s the code on its own