It all works fine for until:
I got my equip animation done right then once it’s done running I wanna switch to an idle animation.
The issue is that the tool is moving to the origin position aka the position it was put in when I created the motor6d in the test dummy. It’s supposed to be somewhere else. I debugged it to see if it is not looping but it is… I’m lost
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
character = player.CharacterAdded:Wait()
end
local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:WaitForChild("Animator")
local Anim = Instance.new("Animation", humanoid)
Anim.AnimationId = "rbxassetid://10827727049"
local Anim2 = Instance.new("Animation", humanoid)
Anim2.AnimationId = "rbxassetid://10830372214"
local EquipAnim = Animator:LoadAnimation(Anim)
local ShoulderArmsAnim = Animator:LoadAnimation(Anim2)
script.Parent.Equipped:Connect(function()
game.ReplicatedStorage.ConnectM6D:FireServer(script.Parent.Musket.BodyAttach)
character.Torso.ToolGrip.Part0 = character.Torso
character.Torso.ToolGrip.Part1 = script.Parent.Musket.BodyAttach
EquipAnim:Play()
EquipAnim.Stopped:Wait()
ShoulderArmsAnim:Play()
ShoulderArmsAnim.Stopped:Wait()
print("Done")
end)
script.Parent.Unequipped:Connect(function()
game.ReplicatedStorage.DisconnectM6D:FireServer()
end)
ShoulderArmsAnim is the Idle animation, it’s looped and the priority is Action
Kind of disappointing to me due to two reasons, 1. exploitable 2. useless. Like c’mon remote servers are not reliable to send data from server to client and yup you will need to do it once just for mouse tracking but welding part can be done on server and/with usage of modules.
Hello, I followed all of your instructions and even checked most or all of the replies but
for some reason the gun gets stuck in my torso. I remember finding a topic about this but I could no longer find it.
What have I tried?
Naming the parts or tools I animate the same name I use for the animation.
In the script where it inserts a M6D inside the torso instead of naming the M6D “ToolGrip” I named it into “BodyAttach”.
I also made sure that I animated the BodyAttach together with the gun model.
Here is the video of the animation:
Here is the video of the game:
I know that the account I use to make the game is different from the account I use in Devforum,
but it’s because I have lots of alt accounts and sometimes even make games in there. Though I will try to transfer the game’s ownership to this account. I also know that this topic is 3 years old but this is the only topic I can relay on when making tool animations.
Edit: I saved the game file and made the game in my main account [the account I am using].
The animation won’t work so I tried to publish the animation using my account and changed the action to action2 [I think changing it was the thing that fixed my solution?]. And my problem was fixed.
The photo of the animation. Now the only problem is how the gun isn’t positioned properly but I believe I could just check the replies in this topic.
one note then i see, because char its dont defined do a error so if a game will have a lot of players will lag a bit so i change the tool script tho fix it
local WeaponTool = script.Parent
local char
script.Parent.Equipped:Connect(function()
local char = WeaponTool.Parent
game.ReplicatedStorage.ConnectM6D:FireServer(WeaponTool.BodyAttach)
char.Torso.ToolGrip.Part0 = char.Torso
char.Torso.ToolGrip.Part1 = WeaponTool.BodyAttach
end)
WeaponTool.Unequipped:Connect(function()
local char = WeaponTool.Parent.Parent.Character
game.ReplicatedStorage.DisconnectM6D:FireServer()
end)
im having a problem where when 2 people are in a server and they have the same tool equipped, and person 1 unequips the tool, then person 2’s tool will fall out of their hands and get removed
video:
This might be a very naive and stupid question but…
Let’s say a player equips a tool and I attach it to their Right Arm using a Motor6D (just a standard Roblox tool, like the sword or rocket launcher but I replace the weld with a Motor6D).
Would animations just work straight out of the box or would I have to parent the tool’s handle to the player character?
Does the tool need to be a model (and not a tool) for it to be recognized as part of the rig?
Do I have to reload a animation when a tool is equipped or is it auto-updated as soon as Roblox detects the Motor6D?
Does the name of the tool itself matter as long as the handle is named correctly? Because I would want to reuse the same animation for multiple tools that all have different names (except for the handle, which will have an consistent name).
yeah i did, however the complications of animating the gun with welded to the torso, makes it unethical to animate, by doing that you’ll end up with so many so many unnecessary key frames that are bunched up to compensate animating the weapon to line up with the hand, however it makes animating easier such as cool reload animations, or throwing the weapon in the air unbounded to the hand
though in the tutorial it said you could do it in blender with constraints, but i don’t know how to do that in blender and let alone know which constraints to use, since the tutorial didn’t list the name of the constraints
and duel wielding, i would like to do that but scripting it might be a bit complicated and im not that good at scripting.
You could modify the script given and clone a line for the motor6d of the other arm and replace the name!!! (torso again, if youd want), for blender, good luck dude, idk NOTHING about that