Hello Developers!
I’ve created an idle animation for a shotgun, below this text is what it is suppose to look like.
When testing the game, this is what the idle animation looks like actually.
As seen in the image above, you can see that the left arm (which Roblox actually calls it the “Right Arm” for some reason) is dislocated, being in the center of the torso rather than being next to the torso.
In order to make the idle animation possible, I’ve scripted a Local-script. What the script does is that when it’s equipped, it will connect itself to the players torso via a Motor6D.
--//Tool and General Information\\--
--Tool---
local Tool = script.Parent
local FireEvent = Tool:WaitForChild("FireEvent")
--Information--
local LoadedAmmo = 6
local CarriedAmmo = 32
local Projectiles = 3
local Spread = 1
local Damage = 15
local AttackIntervalorCooldown = 0.8
--//Player\\--
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Mouse = Player:GetMouse()
--//Function\\--
Tool.Equipped:Connect(function()
game:GetService("ReplicatedStorage").Events.ConnectM6D:FireServer(Tool.Base)
Character:WaitForChild("Torso").BodyAttach.Part0 = Character.Torso
Character:WaitForChild("Torso").BodyAttach.Part1 = Tool.Base
local IdleAnim = Character.Humanoid:WaitForChild("Animator"):LoadAnimation(Tool.Idle)
IdleAnim:Play()
Tool.Unequipped:Connect(function()
game:GetService("ReplicatedStorage").Events.DisconnectM6D:FireServer()
IdleAnim:Stop()
end)
end)