Animation works perfectly fine until my player does it

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)

Well, I’m still a bit confused as to what isn’t working.

In the video when you played the animation, it looked like it worked idk

Yea I’m confused too, in the later half of the video I play that animation on my own character rather than the dummy, and for some reason the handle moves its location which makes the sword go into my body which looks bad. I don’t know whats causing the handle to move as it shouldnt be doing that and I havent done anything to make that happen

Honestly I don’t know. Good luck!

1 Like

thank you and I figured it out so for anyone having the same problem basically the problem was that the C.0 and the C.1 Values were not the exact same as the rig creating that offset so all I did was copy paste the values to be the exact same :man_shrugging:

3 Likes