I have searched this topic but didn’t found anything
so I was making a custom character controller and I wanted to change the cameras position to parts position but Its shows this error… 10:23:05.526 - Position cannot be assigned to
heres the script its not that much I was just testing first…
--28/10/20--
--Variables
--Services
local workSpace = game:GetService("Workspace") -- workSpace
local RunService = game:GetService("RunService") --RunService
--Instances
local player = workSpace:WaitForChild("player"); --player
local camera = workSpace.CurrentCamera; --camera
--Properties
camera.CameraType = Enum.CameraType.Scriptable; --so script can change it
RunService.RenderStepped:connect(function()
camera.CFrame.Position = player.CFrame.Position;
end)
print(camera.CFrame.Position); --prints the position
print(player.CFrame.Position); --prints the position.```
Thanks in advance😀(IDK everyone puts this at last).(why is this in script?)
--28/10/20--
--Variables
--Services
local workSpace = game:GetService("Workspace") -- workSpace
local RunService = game:GetService("RunService") --RunService
--Instances
local player = workSpace:WaitForChild("player"); --player
local camera = workSpace.CurrentCamera; --camera
--Properties
camera.CameraType = Enum.CameraType.Scriptable; --so script can change it
RunService.RenderStepped:connect(function()
camera.CFrame = player.CFrame
end)
print(camera.CFrame); --prints the position
print(player.CFrame); --prints the position.