so, I need my sword animation to work properly, here’s how it should be:
And here’s how it is:
As you can see, the sword goes a little bit to the right when the animation is played. Here’s my Grip to Motor6D script:
local motorName = "Handle"
local player
local character
local humanoid
local isR6
local rightHand
do
script.Parent.Equipped:connect(function()
if player == nil then
player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
end
if character == nil or character.Parent == nil then
character = script.Parent.Parent
humanoid = character.Humanoid
isR6 = humanoid.RigType == Enum.HumanoidRigType.R6
rightHand = isR6 and character:WaitForChild("Right Arm")
end
local getWeld = rightHand:WaitForChild("RightGrip")
local motor = Instance.new("Motor6D")
motor.Name = motorName
motor.Part0 = getWeld.Part0
motor.Part1 = getWeld.Part1
motor.C0 = getWeld.C0
motor.C1 = getWeld.C1
getWeld:Destroy()
motor.Parent = rightHand
end)
end
I’ve looked for solutions on DevForum, but I didn’t find any
Also i’m not a good Roblox LUA coder, so I expect something dumb to be the problem lol