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

Camera manipulation will not work?

I am learning to make Camera manipulation, i got this script from a you tuber, his video was made in jul/11/2017, i am not sure if its outdated because roblox studio, has been doing alot of updates. to get to the point why is this script not working it suppose to get the players camera but its not doing it.

local Player = game.Player.LocalPlayer
local Character = Player.Character or Player.CharcterAdded:wait()
local Camera = workspace.CurrentCamera

repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame


4 comments

0

has2b a localscr0pt? iz localscr0pt rite?

0

Yea, its a local script, i gor it from prezile on youtube

0

On line 8, you do have a part named “CameraPart”, right? If so, is it directly under Workspace or is it in something else?

0

It is directly in workspace

1 answer

I'm assuming this script was made before the update on StarterPlayer. Because of this update, you have to make a script called "CameraScript" under StarterPlayerScripts, so your script, which is outdated and very sloppy

local Player = game.Player.LocalPlayer --typo at "Player" (needs to be Players)
local Character = Player.Character or Player.CharcterAdded:wait() --typo at "CharcterAdded" (CharacterAdded); :wait() is now deprecated in favor of :Wait()
local Camera = workspace.CurrentCamera

repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable --fail
Camera.CFrame = workspace.CameraPart.CFrame

becomes the neater result intended by Roblox below.

--CameraScript (LocalScript) in game.StarterPlayer.StarterPlayerScripts

local Player = script.Parent.Parent --script.Parent = PlayerScripts; PlayerScripts.Parent = Player

repeat wait() until Player.Character
local Character = Player.Character

local Camera = game.Workspace.CurrentCamera

Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace.CameraPart.CFrame

1 comment

0

Ok im going,to see if it works, this is not my script a youtuber did a tutoral using this script.

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