Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera manipulation will not work?

Asked by 6 years ago

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


0
has2b a localscr0pt? iz localscr0pt rite? TheeDeathCaster 2368 — 6y
0
Yea, its a local script, i gor it from prezile on youtube Carforlife1 59 — 6y
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? User#20279 0 — 6y
0
It is directly in workspace Carforlife1 59 — 6y

1 answer

Log in to vote
0
Answered by
y3_th 176
6 years ago

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
0
Ok im going,to see if it works, this is not my script a youtuber did a tutoral using this script. Carforlife1 59 — 6y
Ad

Answer this question