#I cant change the camera position when i touch a part

1 messages · Page 1 of 1 (latest)

fading cedar
#

any error in the script?

neat lance
#

you need a local script to change a player's camera

fading cedar
swift smelt
neat lance
#

local scripts need to be located in the player's character

#

or in the player

fading cedar
#

k ty

#

local camera = workspace.CurrentCamera
local cameraPart = game.Workspace:WaitForChild("Camera Part")
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

humanoid.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Portal") then
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cameraPart.CFrame
end
end)

i tried it like this but now camera is always at the camera part without even touching the portal

mighty roost
#

put the correct part you want to touch