How can i fix my motor6d problem?

Hey guys! i want some help with an issue in my development progress…

i am having some issue with the motor6d orientation and position, my idea is pretty simple.

i need to weld the sword on the right hand with an pre-set position i’ve done, but when i try it in game, the position and orientation are totally different. The reason why i am using motor6d is because i animated with moon animator so the sword can follow up the player’s hand just like i did in the plugin.

Here is the code:

game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
wait(5)
local humanoid = char:FindFirstChild(“Humanoid”)
local RA = char:FindFirstChild(“Right Arm”)
local sword = game.ReplicatedStorage:FindFirstChild(“Sword”):Clone()
local motor = Instance.new(“Motor6D”)
motor.Parent = RA
sword.Parent = RA
motor.Part0 = RA
motor.Part1 = sword
motor.Name = “Sword”
motor.C0 = CFrame.new(0.171, -0.916, -1.701)
motor.C0 = CFrame.fromEulerAnglesXYZ(-0.004, 89.996, -85.502)

end)

end)

Here’s also an video to show you guys.

I hope you guys can help me out!
My bad if this topic dont look too good or the video quality is too bad, i’m new with this community.
Thank you! :sweat_smile:

1 Like