Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is the CFrame not changing?

--[ Var ]--
local Camera = workspace.CurrentCamera 
local Players = game:GetService("Players")
local GameFolder = game.Workspace:WaitForChild("Game")
local CamParts = GameFolder.CamParts.IntroCamParts
--[ Main Code ]--

local function IntroOnPlayerJoin()
	Camera.CameraType = ("Scriptable")
	Camera.CFrame = CamParts.IntroCamPart1.CFrame
	wait(5)
	Camera.CameraType = ("Scriptable")
	Camera.CFrame = CamParts.IntroCamPart2.CFrame
end

Players.PlayerAdded:Connect(IntroOnPlayerJoin)

Why no work, i dont know, do you? local script in replicated first.

thanks for reading, Narwhal

2 comments

0

Use a LocalScript and use CurrentCamera and not Camera.

0

i am using a local script and i am using current camera.

1 answer

When you change a parts position you need to use CFrame.new instead of just CFrame

--[ Var ]--
local Camera = workspace.CurrentCamera 
local Players = game:GetService("Players")
local GameFolder = game.Workspace:WaitForChild("Game")
local CamParts = GameFolder.CamParts.IntroCamParts
--[ Main Code ]--

local function IntroOnPlayerJoin()
    Camera.CameraType = ("Scriptable")
    Camera.position = CFrame.new(CamParts.IntroCamPart1.position)
    wait(5)
    Camera.CameraType = ("Scriptable")
    Camera.position = CFrame.new(CamParts.IntroCamPart2.position)
end

Players.PlayerAdded:Connect(IntroOnPlayerJoin)

This discussion is preserved as it was. New answers, comments, and votes are closed.