-
What do you want to achieve? Keep it simple and clear!
I want forever updating CFrame, like I have made Camera that is welded to player’s head, everything is fine, but now I want to update the CFrame when the player moves, just like first-person mode -
What is the issue? Include screenshots / videos if possible!
I tried a lot of solutions, but nothing worked. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I was researching, finding the solution on my own, but nothing worked.
Here’s the local script that I’m working on. This game will be 1 player only.
The camera shows POV of the player’s head, but doesn’t updates. I tried with while, run services, but I have no clue.
local players = game:WaitForChild("Players")
local player = players.LocalPlayer
local chr = player.Character
local CCamera = Instance.new("Part")
CCamera.Name = "Camera"
CCamera.Parent = chr.Head
CCamera.Position = Vector3.new(chr.Head.Position.X, chr.Head.Position.Y, chr.Head.Position.Z)
CCamera.Anchored = false
CCamera.CanCollide = false
game:WaitForChild("Workspace").CurrentCamera.CameraType = Enum.CameraType.Scriptable
local newWelder = Instance.new("WeldConstraint")
newWelder.Parent = chr
newWelder.Part0 = CCamera
newWelder.Part1 = chr.Head
CCamera.Position = chr.Head.Position
game:WaitForChild("Workspace").CurrentCamera.CFrame = CCamera.CFrame