I am trying to make the arms move with arms (looking at mouse position)
but this happen:
The animation I use for this tools is:
Hello everybody! I’m Headstackk, I’ve been creating and making firearm weapons on Roblox for a while. I’ve also created the game Weaponry . In this post, I will briefly explain how to get started to animate a weapon on Roblox.
I have already briefly explain how on this DevForum post , but I’d like to make a new post to clarify everything and explain it step by step.
In most of the Roblox Shooter games (Excluding advanced shooter games such as Phantom Forces), I observed that they usually make a …
This is the script I am using for move arms.
Local script:
local run = game:GetService("RunService")
run.RenderStepped:Connect(function()
if equipped then
local rightX, rightY, rightZ = char.Torso["Right Shoulder"].C0:ToEulerAnglesYXZ()
char.Torso["Right Shoulder"].C0 = (char.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
local leftX, leftY, leftZ = char.Torso["Left Shoulder"].C0:ToEulerAnglesYXZ()
char.Torso["Left Shoulder"].C0 = (char.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y))
end
end)
I dont know if is because the animations I am using but I dont think is because of that.
The animations system are basic
*Server Side*
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local M6D = Instance.new("Motor6D")
M6D.Name = "ToolGrip"
M6D.Parent = char.Torso
end)
end)
game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr,location)
local char = plr.Character
char.Torso:FindFirstChild("ToolGrip").Part0 = char.Torso
char.Torso:FindFirstChild("ToolGrip").Part1 = location
end)
game.ReplicatedStorage.DisconnectM6D.OnServerEvent:Connect(function(plr)
plr.Character.Torso:FindFirstChild("ToolGrip").Part0 = nil
plr.Character.Torso:FindFirstChild("ToolGrip").Part1 = nil
end)
*Local Script*
tool.Equipped:Connect(function()
----Animations----
local char = plr.Character or plr.CharacterAdded:Wait()
game.ReplicatedStorage.ConnectM6D:FireServer(tool.ToolsParts.BodyAttach)
char.Torso.ToolGrip.Part0 = char.Torso
char.Torso.ToolGrip.Part1 = tool.ToolsParts.BodyAttach
local Humanoid = char:FindFirstChild("Humanoid")
idle = Humanoid:LoadAnimation(script:WaitForChild("Idle"))
idle:Play()
end)
This is how the tool looks like:
Moleza
(Moleza)
December 20, 2021, 11:02pm
#3
as i can see, you parented to character Torso, try to parenting to RightHand or LeftHand, because since that thing is attached to your torso, if you move your torso, the minigun will move, [in this case, moving the arms will not animate the minigun]
[correct me if i said something wrong]
char.Torso:FindFirstChild("ToolGrip").Part0 = char.Torso -- Change Torso to RightHand of the humanoid
--and do that with the rest
char.Torso:FindFirstChild("ToolGrip").Part1 = location
1 Like
I mean I dont think that can help because I am not using “Handle”
the rest is other Motor6D for every arm?
Moleza
(Moleza)
December 20, 2021, 11:15pm
#7
Try this: (changed torsos)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local M6D = Instance.new("Motor6D")
M6D.Name = "ToolGrip"
M6D.Parent = char.RightHand
end)
end)
game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr,location)
local char = plr.Character
char.RightHand:FindFirstChild("ToolGrip").Part0 = char.RightHand
char.RightHand:FindFirstChild("ToolGrip").Part1 = location
end)
game.ReplicatedStorage.DisconnectM6D.OnServerEvent:Connect(function(plr)
plr.Character.RightHand:FindFirstChild("ToolGrip").Part0 = nil
plr.Character.RightHand:FindFirstChild("ToolGrip").Part1 = nil
end)
*Local Script*
tool.Equipped:Connect(function()
----Animations----
local char = plr.Character or plr.CharacterAdded:Wait()
game.ReplicatedStorage.ConnectM6D:FireServer(tool.ToolsParts.BodyAttach)
char.RightHand.ToolGrip.Part0 = char.RightHand
char.RightHand.ToolGrip.Part1 = tool.ToolsParts.BodyAttach
local Humanoid = char:FindFirstChild("Humanoid")
idle = Humanoid:LoadAnimation(script:WaitForChild("Idle"))
idle:Play()
end)
1 Like
B2ontwitch
(B2ongalaxy)
December 20, 2021, 11:16pm
#8
You have to use rigid constraints to connect the minigun to the player.
1 Like
from the bodyAttach to the arm?
Moleza
(Moleza)
December 20, 2021, 11:25pm
#11
you will need to animate the minigun again, btw
Oh ok thank you let me just test it.
It works just fine… I think in something about weld with arms but I didnt tried but now I see it works very fine thank you.
1 Like