I dont mean TO the player, i more mean like above them.
Im plannign on making this dumb little deleivery drone that drops your package on your head… but i dont mess with cframes… too complicated.
Can someone help me?
Part.CFrame = Character.Head.CFrame * CFrame.new(0,-10,0)
Run this on a loop, if it don’t work then change the -10 to 10.
1 Like
local heightAbovePlayer = 5
local RunService = game:GetService("RunService")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
RunService.Heartbeat:Connect(function()
local playerHead = player.Character:FindFirstChild("HumanoidRootPart")
local part = workspace:FindFirstChild("Part")
part.Position = Vector3.new(playerHead.Position.X, playerHead.Position.Y+heightAbovePlayer , playerHead.Position.Z)
end)
end)
end)
this should solve your issue, get back to me if you have any issues
This is a pretty poor implementation. Every time the character respawns a new .Heartbeat connection is created without disconnecting the old one. You’d preferably want to create a pool of parts with an associated player and then loop through that pool moving every part to its associated player inside a single .Heartbeat event.
1 Like