In the API Reference: WeldConstraint | Roblox Creator Documentation
It states:
Roblox handles moving a welded part differently depending on whether the part was moved using its Position or with its CFrame .
If a welded part’s Position is updated, the part will move but none of the connected parts will move with it. The weld will recalculate the offset from the other part based on the part’s new position.
You are moving the whole character when you set the Arrow’s CFrame. (Not gud)
Instead of changing the CFrame, try figuring out a way to change orientation. Let me try to figure it out myself, rq.
Quoted from the API Reference:
In contrast, if a part’s CFrame is updated, that part will move and any part welded to that part will also move. These other parts will be moved to make sure they maintain the same offset as when the weld was created.
You’re changing the CFrame of the part constantly, aka moving the character. Which, in this case, is not good.
If you did:
local Arrow = script:WaitForChild("Arrow")
Arrow.CFrame = Character.Head.CFrame * CFrame.Angles(0, 0, math.rad(90)) + Vector3.new(0, 4, 0)
Arrow.WeldConstraint.Part0 = Character.Head
Arrow.Parent = Character.HumanoidRootPart
Arrow.Anchored = false
--// Update the arrow
local function UpdateArrow()
local Info = string.split(tostring(CFrame.new(Arrow.Position, workspace.RandomPart.Position)), ", ")
Arrow.Orientation = Vector3.new(Info[1], Info[2], Info[3])
end
RunService.Stepped:Connect(UpdateArrow)
This would NOT change the character’s position, effectively not flinging them to the surface of the moon.
That causes my character to go flying off into the void. And if I make the arrow unanchored, it just falls through the world and is gone and destroyed before I’m even able to see my character
Works well! Just quick question, if I have this inside StarterCharacter, should I be unbinding the action on death, to prevent any memory leaks or what not?