When i player touches an object the camera goes to a specific part, but when i try getting the camera back to normal it doesn’t work. I"m trying to use a remote event named BackToNormal.
THis is the script in the part that is supposed to get the player’s camera back to normal
local part = script.Parent
local players = game:GetService("Players")
local replicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = replicatedStorage.RemoteEvents.ChangeCamera:WaitForChild("BackToNormal")
part.Touched:Connect(function(toucher)
if players:GetPlayerFromCharacter(toucher.Parent) then
local player = players:GetPlayerFromCharacter(toucher.Parent)
remoteEvent:FireClient(player)
end
end)
And this local script is in StarterPlayerScript
local Camera = workspace.CurrentCamera -- CAMERA
local ReplicatedStorage = game:GetService("ReplicatedStorage") -- REPLICATED STORAGE
local RemoteEvent = ReplicatedStorage.RemoteEvents.ChangeCamera--:WaitForChild("ChangeCamera1") -- REMOTE EVENT
RemoteEvent.BackToNormal.OnClientEvent:Connect(function(charater) -- PLAYER RECEIVING THE SIGNAL
Camera.CameraType = Enum.CameraType.Custom
Camera.CFrame = CFrame.new(Vector3.new(0, 5, -10), Vector3.new(0, 5, 0))
end)
How can i fix my script to reset the player’s camera to normal?