Hello,
I would like to know how can I set the attachment of my tool to another attachment? I mean, imagine placing a weapon on the head for example and not in the hand.
Hello,
I would like to know how can I set the attachment of my tool to another attachment? I mean, imagine placing a weapon on the head for example and not in the hand.
Hello. You could try to Motor6D tool to the Head when you equip it.
Tool.Equipped:Connect(function()
local motor = Instance.new("Motor6D")
motor.Name = name it whatever you want
motor.Parent = Character.Head
motor.Part0 = Character.Head
motor.Part1 = Tool.Handle
end)
Tool.Unequipped:Connect(function()
Character.Head:FindFirstChild("name you set"):Destroy()
end)
The part to “link” the tool with the Hand for example is in a bone, so there is a difference or no?
Do you mean if there is difference where motor is parented? Or are you asking if Part0 and Part1 locations matter? I don’t quite understand what you mean by that.
Let me explain:
In my character you have a part whose name is “RootPart” which contains the bones of the character. Then to have a part which follow the bone I added a part into this bone.
There is not a problem if the part to link tool + hand is in the bone?
local tool = script.Parent
local handle = tool:FindFirstChild("Handle")
local plr = game:GetService("Players").LocalPlayer
local character = plr.Character
local humanoid = character:FindFirstChild("Humanoid")
local EquipAnim = script:WaitForChild("Equip_ARI")
local EquipAnimTrack = humanoid.Animator:LoadAnimation(EquipAnim)
local bone = character.RootPart:FindFirstChild("Bone"):FindFirstChild("Bone.001"):FindFirstChild("Bone.012"):FindFirstChild("Bone.013"):FindFirstChild("Bone.014"):FindFirstChild("Bone.015"):FindFirstChild("Bone.016"):FindFirstChild("Bone.017"):FindFirstChild("Bone.018")
tool.Equipped:Connect(function()
local motor = Instance.new("Motor6D", bone:FindFirstChild("PositionRightHand"))
motor.Name = "MotorRH"
motor.Part1 = handle
motor.Part0 = bone:FindFirstChild("PositionRightHand")
EquipAnimTrack:Play()
end)
tool.Unequipped:Connect(function()
bone:FindFirstChild("PositionRightHand"):FindFirstChild("MotorRH")
EquipAnimTrack:Stop()
end)
Hello. Sorry for the wait!
C0
and C1
are CFrame values. I am talking about welding the handle to part.
motor.Part0 = Character.Head
motor.Part1 = Tool.Handle
Yeah I saw, so I fixed with part0 & part1 but it’s “bugging” my character.
You need Part0
to be Right Hand and Part1
to be Handle.
local tool = script.Parent
local handle = tool:FindFirstChild("Handle")
local plr = game:GetService("Players").LocalPlayer
local character = plr.Character
local humanoid = character:FindFirstChild("Humanoid")
local EquipAnim = script:WaitForChild("Equip_ARI")
local EquipAnimTrack = humanoid.Animator:LoadAnimation(EquipAnim)
local bone = character.RootPart:FindFirstChild("Bone"):FindFirstChild("Bone.001"):FindFirstChild("Bone.012"):FindFirstChild("Bone.013"):FindFirstChild("Bone.014"):FindFirstChild("Bone.015"):FindFirstChild("Bone.016"):FindFirstChild("Bone.017"):FindFirstChild("Bone.018")
tool.Equipped:Connect(function()
local motor = Instance.new("Motor6D", bone:FindFirstChild("PositionRightHand"))
motor.Name = "MotorRH"
motor.Part1 = handle
motor.Part0 = bone:FindFirstChild("PositionRightHand")
EquipAnimTrack:Play()
end)
tool.Unequipped:Connect(function()
bone:FindFirstChild("PositionRightHand"):FindFirstChild("MotorRH")
EquipAnimTrack:Stop()
end)
Is your tool’s Grip position 0,0,0
?
Could i see the tool’s model?
characters
Try parenting Motor6D after all attributes are set and not inside Instance.new()
and let’s see if it does something.
I did not understand, can you explain :>?
Instead of this do
local motor = Instance.new("Motor6D")
-- attributes..
motor.Parent = bone:FindFirstChild("PositionRightHand")
Tried but it does not fix the problem :(.