robloxapp-20210513-0412007.wmv (653.8 KB)
When the tool is equipped, it plays an idle animation through Humanoid:LoadAnimation then fires a RemoteEvent to the server to remove the original tool weld and create a Motor6D connecting the arm and handle.
Here’s the rig for the gun:
Here’s the scripts:
CLIENT
function eq()
wait()
hum = game.Players.LocalPlayer.Character.Humanoid
if hum.Health > 0 then
hl = hum:LoadAnimation(game.ReplicatedStorage:FindFirstChild(script.Name).hold)
game.ReplicatedStorage.AnimateEvent:FireServer(hum, script.Parent.HandleMotor6D, Tool, false)
wait()
hl:Play()
end
end
script.Parent.Parent.Equipped:Connect(eq)
SERVER SCRIPT
function loadmotor(player,hum,motor,tool,del)
if motor then
if del == false then
m6d = motor:Clone()
m6d.Parent = hum.parent['Right Arm']
m6d.Part0, m6d.Part1 = m6d.Parent, tool.Handle
hum.Parent['Right Arm'].RightGrip.Part1 = nil
else
hum.Parent['Right Arm'].HandleMotor6D:Destroy()
end
end
end
game.ReplicatedStorage.AnimateEvent.OnServerEvent:Connect(loadmotor)
-
The animation seems to replicate to the server properly since the arms are correctly animated, but the tool doesn’t change positions until the player is touched.
-
I’ve tried setting the NetworkOwner of the gun’s parts to the player to no avail
-
The animation priorities are all set to Action.
-
The odd thing about this is that this behaviour isn’t present when doing server simulation in Studio, and it only happens one-way (the other player’s animation loads normally for them at all times). Furthermore, this only started happening a few days ago; it worked perfectly fine before then. As such I don’t know if there’s the possibility of this being a finicky engine/network thing.
Any help is appreciated.