Hello. I was trying to make a part that follows the camera's x, y, and z position. Could you help me out? There's no error, it just doesn't work.
local owner = game.Players.iiDkOffical local head = Instance.new("Part") head.Name = "Head" local group = Instance.new("Model") group.Name = owner.Name.." - Game Time: "..elapsedTime() head.Parent = group head.Size = Vector3.new(1,1,1) head.Position = Vector3.new(game:GetService("Workspace").CurrentCamera.CFrame)
Position is a three-dimensional vector, to modify a userdata, you must cast the respective datatype to it. You casted a CFrame, which contradicts the datatype of Position. To ensure you're casting a proper Vector3 of CFrame, use the
.p component which represents the Positional constant.
Part.Position = workspace.CurrentCamera.CFrame.p --// Returns a Vector3 automatically