I want it to face the portal and I cant get it.
This is my current code which barely works.
local Camera = game.Workspace.CurrentCamera
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local CameraPieceFinal = game.Workspace.CameraPieceFinal
--// joining
repeat wait() until Player.Character
print("yass repeating")
Camera.CameraType = "Scriptable"
Camera.CFrame = game.Workspace.CameraPiece.CFrame
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
--Camera.CameraType = "Custom" incase you want back to regular camera
ChapterOneButton.MouseButton1Click:Connect(function()
local time = 1
local tweenInfo = TweenInfo.new(time, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
TweenService:Create(workspace.CurrentCamera, tweenInfo, {CFrame = CFrame.new(-515.835, 21.09, 127.772)}):Play()
wait(1)
CameraPieceFinal.CFrame = game.Workspace.CurrentCamera.CFrame:Lerp(CameraPieceFinal.CFrame, 0.5)
game.Workspace.CurrentCamera.CFrame = CFrame.new(-515.835, 21.09, 127.772)
-- this line above is attempted to make it so it stays there (not working)
end)
Here is what I had to try and change the orientation but it isnt working.
local Camera = game.Workspace.CurrentCamera
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local CameraPieceFinal = game.Workspace.CameraPieceFinal
--// joining
repeat wait() until Player.Character
print("yass repeating")
Camera.CameraType = "Scriptable"
Camera.CFrame = game.Workspace.CameraPiece.CFrame
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
--Camera.CameraType = "Custom" incase you want back to regular camera
ChapterOneButton.MouseButton1Click:Connect(function()
local time = 1
local tweenInfo = TweenInfo.new(time, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
TweenService:Create(workspace.CurrentCamera, tweenInfo, {CFrame = CFrame.new(-515.835, 21.09, 127.772) * CFrame.Angles(math.rad(0 ,(90) ,0))}):Play()
wait(1)
CameraPieceFinal.CFrame = game.Workspace.CurrentCamera.CFrame:Lerp(CameraPieceFinal.CFrame, 0.5)
game.Workspace.CurrentCamera.CFrame = CFrame.new(-515.835, 21.09, 127.772)
end)
Video of what happens (With the second script) below
Argument 3 missing or nil - Client - Main:47
Video of what happens (With the first script) below
no errors scriptwise, but not facing or staying in position