Through a normal script (code shown below) I'm calling a localscript to handle the user's camera when they hit a part to trigger a cutscene.
lua
-- Regular script
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
script.RemoteEvent:FireClient(game.Players[hit.Parent.Name])
end
end)
(The localscript is the child of the RemoteEvent
, and the regular script is the parent of the RemoteEvent
.)
```lua
-- LocalScript
script.Parent.OnClientEvent:Connect(function()
local cam = workspace.CurrentCamera
cam.CameraSubject=workspace.complex.tele
cam.Focus = CFrame.new(workspace.complex.tele.Position) * CFrame.new(0, -4, 0)
end) ``` Now this looks all well and good, but actually, it doesn't do anything to the camera. I'm not sure what exactly is going on here. Help would be appreciated!
The local script has to be in the starter pack, or the startergui. you have to define the remote event from the local script and the regular script. I prefer putting the remote event in replicated storage
Thank you for pointing this out, @bojigglesmister2!