Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I change the position of part welded to player?

Asked by
Hypgnosis 186
4 years ago

I am wondering how I can change the position and/or orientation of a part which is welded to the player's hand (R15).

Here is what I have right now: https://gyazo.com/845610686765e63adc8966bbc237c0a9

The blue highlight is the part which I have welded to the player's hand. It has a particle emitter which is meant to be fire.

My problem is that the part and fire are half inside the player's hand, while I need it to be just outside the player's hand and parallel to the ground (so the particles fly straight up). Similar to:

https://gyazo.com/785755a9a8e66b5e49363912f150447e

I've tried changing the CFrame of the part just before welding it, but to no avail:

Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        wait(3)
        workspace.Part.CFrame = Player.Character.RightHand.CFrame * CFrame.new(0, -5, 0)
        local weld = Instance.new("Weld")
        weld.Parent = workspace.Part
        weld.Part0 = workspace.Part
        weld.Part1 = Player.Character.RightHand
    end)
end)

Any help would be much appreciated.

Answer this question