Animation issue?

Okay, so I animated this weapon in Roblox Studio’s Animator. I created a Motor6D in the Rig’s Torso and set Part 1 to the weapon (as it’s a single part) and Part0 to the Torso.

However, in-game, the bar does not move.

I have some scripts which creates a Motor6D in the Player’s Torso when they join on the SERVER side. The other script connects it on the client for better visuals, however the weapon does not seem to be working.

In studio:


In game:

Scripts:
Server

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(character)
		M6D = Instance.new("Motor6D", character.Torso) -- or the part that you have decieded
		M6D.Name = "ToolGrip"
		M6D.Part0 = character.Torso
		character.ChildAdded:Connect(function(child)
			if (child:IsA("Tool") and child:FindFirstChild("BodyAttach")) then
				M6D.Part1 = child:FindFirstChild("BodyAttach")
			end
		end)
	end)
end)

Client

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local M6D = nil
character.ChildAdded:Connect(function(child)
	M6D = character.Torso:WaitForChild("ToolGrip")
	if (child:IsA("Tool") and child:FindFirstChild("BodyAttach")) then
		M6D.Part1 = child:FindFirstChild("BodyAttach")
	end
end)

Oh and yeah, server and client are in separate scripts. Server is in ServerScriptStorage and Client is in StarterCharacterScripts.

Is the bar Anchored or is it Weled to the characters hand, or are you defining a Tool?

I fixed the issue just now.
It turns out when I animated it it wasn’t named correctly (should have been named BodyAttach)
I re-animated it with the new name and it works now

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.