Hello, Recently I've got into camera manipulation, and I've tried to make cutscenes, I've made one, with help of the wiki, which I do now understand.
But, my question is:
This cutscene plays when a player joins the server, how do I make it play when a player touches a certain part? I can't find any tutorials for this on the wiki, if anyone knows where to find them, then please link them to me!
-- localscript in starterGui
local player = game.Players.LocalPlayer
local TweenService = game:GetService("TweenService")
local cam = workspace.CurrentCamera
function play(char)
local PP = char.PrimaryPart
cam.CameraType = Enum.CameraType.Scriptable
local BCFrame = PP.CFrame * CFrame.new(10,10,10) * CFrame.new(0,math.pi,0)
local targetCFrame = PP.CFrame * CFrame.new(0, 0, -10) * CFrame.Angles(0, math.pi, 0)
cam.CFrame = BCFrame
local tween = TweenService:Create(
cam,
TweenInfo.new(2),
{CFrame = targetCFrame}
)
tween:Play()
tween.Completed:Wait()
cam.CameraType = Enum.CameraType.Custom
end
player.CharacterAdded:Connect(function(character)
wait(3)
play(game.Players.LocalPlayer.Character)
end)
Thanks for your time
