Why does Motor6D not play for this specific part?

I’m having an issue with animation specifically the weapon animation.

I create the weld (Motor6D) in the server and change it values there, while the client plays the animation and fire a remote event to sync the weld values changing. For some unknown reason it won’t let the weapon go to it’s coordinate positions.

Animation

Ingame

2 Likes

I would suggest looking into this tutorial if you haven’t already: link

but have you turned off “requires handle”? Made sure it was set up properly?

2 Likes

I’m not using a tool tho, I’m using userinputservice

I would recommend converting it to a tool, because I don’t know how to help you outside of that.

still not working even with tool6d

if its working the way you’re saying it is, then maybe the automatic replication of the motor is causing it to be reverted to an old state

if the client has ownership over the sword, then it should relay the changes to the motor6d without any manual scripting required

I changed my thing back to UIS because I don’t like tools. Anyways I see that your saying the automatic replication of the motor is the problem?

I can give you my entire code (pretty bad writing), if you want to examine it.

it’s more-so that the automatic replication conflicts with your manual replication, but yeah. (Presuming you are manually replicating it, that is)

code would be helpful

-- Module
local Weld = {}
local RS = game:GetService("ReplicatedStorage")

local Weapons = RS.Weapons
local weaponWelds = script.welds

local Events = RS.Events
local equipEvent = Events:WaitForChild("equipEvent")

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local charValues = char:WaitForChild("valuesFolder")
		local torso = char.Torso

		local weaponModel = Weapons[charValues.Weapon.Value]:Clone()
		weaponModel.Parent = char
		weaponModel.Name = "Weapon"

		local weldValues = weaponWelds[charValues.Weapon.Value]
		local weld = Instance.new("Motor6D")
		weld.Parent = char
		weld.Name = "weaponWeld"

		weld.Part0 = torso
		weld.Part1 = weaponModel
		weld.C1 = weldValues.weaponRest.C1
	end)
end)

function Weld.weldEquip(char,equip)
	local torso = char.Torso
	local rightArm = char["Right Arm"]

	local charValues = char:WaitForChild("valuesFolder")
	local weapon = char:WaitForChild("Weapon")
	local weld = char:WaitForChild("weaponWeld")
	local weldValues = weaponWelds[charValues.Weapon.Value]
	
	if equip then
		weld.Part0 = rightArm
		weld.C1 = weldValues.weaponHold.C1
		weld.CurrentAngle = 0
	else
		weld.Part0 = torso
		weld.C1 = weldValues.weaponRest.C1
		weld.CurrentAngle = 0
	end
	
	equipEvent:FireServer(weld)
end

equipEvent.OnServerEvent:Connect(function(plr,equip)
	Weld.weldEquip(plr.Character,equip)
end)

return Weld
-- Local
local uis = game:GetService("UserInputService")
local rs = game:GetService("ReplicatedStorage")
local plrService = game:GetService("Players")

local plr = plrService.LocalPlayer
local char = plr.Character
local animator = char.Humanoid.Animator

local weapon = char:WaitForChild("Weapon")
local equipAnims = weapon.equipAnims
local events = rs.Events
local keybindsFolder = script.Parent.Keybinds

local equipAnim = animator:LoadAnimation(equipAnims.equip)
local unequipAnim = animator:LoadAnimation(equipAnims.unequip)

local equip = false

local equipEvent = events.equipEvent
local equipAnim = animator:LoadAnimation(equipAnims.equip)
local holdAnim = animator:LoadAnimation(equipAnims.hold)
local unequipAnim = animator:LoadAnimation(equipAnims.unequip)

uis.InputBegan:Connect(function(input,isTyping)
	if isTyping then return end

	if input.KeyCode == Enum.KeyCode[keybindsFolder.equipWeapon.Value] then
		if equipAnim.IsPlaying or unequipAnim.IsPlaying then return end

		if equip == false then
			equipAnim:GetMarkerReachedSignal("weld"):Connect(function()
				equipEvent:FireServer(equip)
			end)

			if equipAnim.Ended then
				holdAnim:Play()
			end

			equipAnim:Play()
			equip = true
		else
			holdAnim:Stop()

			unequipAnim:GetMarkerReachedSignal("weld"):Connect(function()
				equipEvent:FireServer(equip)
			end)

			unequipAnim:Play()
			equip = false
		end
	end
end)

The weld module I’m making is unfinished rn