I’m trying to make a flying broom and currently it does move however the broom doesn’t following the direction of the camera. The broom has a handle that has a ConstraintWeld to the HumanoidRootPart. This is my code so far and it doesn’t seem to work.
connection = flyingEvent.OnServerEvent:Connect(function(player, keyPressed)
local character = player.Character or player.CharacterAdded
--local humanoid = character:WaitForChild('Humanoid')
local camera = game:GetService('Workspace').CurrentCamera
local humanoidRootPart = character:WaitForChild('HumanoidRootPart')
local cameraDirection = humanoidRootPart.CFrame:ToObjectSpace(camera.CFrame).LookVector
broom:WaitForChild('Handle').CFrame = CFrame.new(broom:WaitForChild('Handle').Position, Vector3.new(camera.CFrame.LookVector.X * 900000, broom:WaitForChild('Handle').Position.Y, camera.CFrame.LookVector.Z * 900000))