Hello, I am having trouble with a tool and its animation. Whenever the tool is equipped, the tool (or spear in this case) seems to snap/teleport to the player
Below is a local script where equipped function is being used:
Easy fix, move the spear model out of the tool instance and put it inside of replicated storage or somewhere other than the tool.
event.OnServerEvent:Connect(function(Player: Player, Tool: Tool)
-- Player character
local character = Player.Character
local right_arm: BasePart = character:FindFirstChild("Right Arm")
-- Mark the character as equipping a weapon
character.WeaponEquipped.Value = true
-- Get the tool model
local tool_model: Model = ReplicatedStorage:FindFirstChild(Tool.Name)
if not tool_model then warn(Tool.Name, "isnt a valid toolmodel") return end
tool_model = tool_model:Clone()
-- Get the models handle
local handle: BasePart? = tool_model.PrimaryPart
-- Create the motor to connect the toolmodel and character
local motor: Motor6D = Instance.new("Motor6D")
motor.Part0 = right_arm
motor.Part1 = handle
motor.C0 = tool_model:FindFirstChild("Value").Value
motor.Parent = right_arm
-- Parent the tool model
tool_model.Name = "ToolModel"
tool_model.Parent = character
-- Your event
weldComplete:FireClient(Player)
end)