I’ve created an animation in blender, which works fine there, and after importing, it works perfectly fine. But for some reason when I have my character play the animation, and only during the animation the handle moves. When I walked around it was in the right position, which makes me think it can’t be a problem with my script, I think? and the animation works flawlessly on the dummies and in blender. I’m completely unsure what it could be. Please help
local repStorage = game:GetService("ReplicatedStorage")
local firstlight = repStorage:WaitForChild("First Light")
local players = game:GetService("Players")
local equipRemoteEvent = repStorage:WaitForChild("Remote Events"):WaitForChild("equipRemoteEvent")
local unequipRemoteEvent = repStorage:WaitForChild("Remote Events"):WaitForChild("unequipRemoteEvent")
equipRemoteEvent.OnServerEvent:Connect(function(player)
print("attempting to equip")
local char = player.Character
if char then
local firstlightclone = firstlight:Clone()
firstlightclone.Parent = char
local motor6dweld = Instance.new("Motor6D")
motor6dweld.Name = "Handle"
motor6dweld.Parent = char:WaitForChild("Right Arm")
motor6dweld.Part0 = char:WaitForChild("Right Arm")
motor6dweld.Part1 = firstlightclone.Handle
motor6dweld.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90), 0, 0) -- Rotate the arm in the x-axis if necessary
motor6dweld.C1 = CFrame.new(-1, 0, 0) * CFrame.Angles(math.rad(0), math.rad(90), 0) -- Adjust the weapon orientation in the y-axis if needed
local defaultanims = char:WaitForChild("Animate")
defaultanims.Enabled = false
local animations = repStorage:FindFirstChild("Animations"):WaitForChild("giant swordAnimations"):WaitForChild("GiantSword Animate")
local animclone = animations:Clone()
animclone.Parent = char
end
end)
unequipRemoteEvent.OnServerEvent:Connect(function(player)
local char = player.Character
if char then
if char:FindFirstChild("First Light") then
char:FindFirstChild("First Light"):Destroy()
char:FindFirstChild("GiantSword Animate"):Destroy()
local defaultanims = char:WaitForChild("Animate")
defaultanims.Enabled = true
end
end
end)