My arm are acting weird(misallign) when playing animation

I use headstack way to animate gun model but my arm animation is not allign with the same way animation editor

here is the arm idle animation misallign

here is in the animation editor

I have try changing changing animation priority
I have try remake the animation in moon animator2 and same problem

any help would be nice
client code

local player = game.Players.LocalPlayer
local character = player.Character
local Mouse = player:GetMouse()
local tool = script.Parent
local Cursor = game.Players.LocalPlayer:GetMouse().Icon
local MaxFireRate = 0.066
local Debounce = false
local Reloading = false

local HudUpdate = game.ReplicatedStorage.Hud.HudUpdate

local ContextActionService = game:GetService("ContextActionService")

function onSpawn()
	game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true);
end
onSpawn();
character:WaitForChild("Humanoid").Died:Connect(function()
	game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false);
end)

local Run = Instance.new("Animation")
Run.AnimationId = "rbxassetid://11523947534"
local Idle = Instance.new("Animation")
Idle.AnimationId = "rbxassetid://11947645089"
local Shooting = Instance.new("Animation")
Shooting.AnimationId ="rbxassetid://11947636807"
local ReloadAni = Instance.new("Animation")
ReloadAni.AnimationId = "rbxassetid://11947559770"

local animation = Instance.new("Animation")
local animator = character.Humanoid:FindFirstChildOfClass("Animator")


local IdlePlay = animator:LoadAnimation(Idle)
local ShootingPlay = animator:LoadAnimation(Shooting)
local Runplay = animator:LoadAnimation(Run)
local ReloadAni = animator:LoadAnimation(ReloadAni)

function Reloaded()
	if  Reloading then return end
	Reloading = true
	tool.Reload:FireServer()
	ReloadAni:Play()
	ReloadAni:GetMarkerReachedSignal("Magin"):Connect(function()
		tool.M1911insert:Play()
	end)
	ReloadAni:GetMarkerReachedSignal("Srelease"):Connect(function()
		tool.M1911SlideRelease:Play()
	end)
	ReloadAni.Stopped:Wait()
	Reloading = false
end

script.Parent.Equipped:Connect(function()
	
	HudUpdate:FireServer()
	game.ReplicatedStorage.GunsM6D.M1911M6D:FireServer(tool.BodyAttach)

	character.UpperTorso.ToolGrip.Part0 = character.UpperTorso
	character.UpperTorso.ToolGrip.Part1 = tool.BodyAttach
	
	IdlePlay:Play()
	
	ContextActionService:BindAction("Reload", function(name,state,obj)
		if state == Enum.UserInputState.Begin then
			Reloaded()
		end	
	end,true,Enum.KeyCode.R)
	
end)

tool.Unequipped:Connect(function()
	game.Players.LocalPlayer:GetMouse().Icon = Cursor
	game.ReplicatedStorage.GunsM6D.M1911DISCONNECTM6D:FireServer()
	IdlePlay:Stop()
	
	ContextActionService:UnbindAction("Reload")
end)

tool:WaitForChild("Reload").OnClientEvent:Connect(Reloaded)

tool.Activated:Connect(function()
	if not Debounce and Reloading == false then
		Debounce = true
		local mousePosition = Mouse.Hit.Position
		ShootingPlay:Play()
		tool.Fire:FireServer(mousePosition)
		task.wait(MaxFireRate)
		Debounce = false
	end
end)

server

local Range = 525
local Dmg = 30
local character
local DefaultRunAnimID

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		character = Character
		local PlayerCharacter = workspace:WaitForChild(Player.Name)
		local M6D = Instance.new("Motor6D")
		
		M6D.Name = "ToolGrip"
		M6D.Parent = PlayerCharacter.UpperTorso
	end)
end)


game.ReplicatedStorage.GunsM6D.M1911M6D.OnServerEvent:Connect(function(Player,Location)
	local character = Player.Character
	DefaultRunAnimID = character.Animate.run.RunAnim.AnimationId

	character.Animate.run.RunAnim.AnimationId = "rbxassetid://11523947534"
	character.UpperTorso.ToolGrip.Part0 = character.UpperTorso
	character.UpperTorso.ToolGrip.Part1 = Location
end)

game.ReplicatedStorage.GunsM6D.M1911DISCONNECTM6D.OnServerEvent:Connect(function(Player)
	character.Animate.run.RunAnim.AnimationId = DefaultRunAnimID
	Player.Character.UpperTorso.ToolGrip.Part1 = nil
end)

client

local tool = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Cursor = mouse.Icon
local character = player.Character
local TopPart = character.UpperTorso
local animated = false
local CasingEffect = script.Parent.CasingEffect
local M1911Slide = script.Parent.M1911Slide
local M1911SlideRelease = script.Parent.M1911SlideRelease
local M1911insert = script.Parent.M1911insert
local M1911insertMag = script.Parent.M1911insertMag

local MuzzleEffect = script.Parent.MuzzleEffect
local Muzzle = MuzzleEffect.MuzzleFlash
local MuzzleAttach = MuzzleEffect.MuzzleAttach
local MuzzleAttach0 = MuzzleEffect.MuzzleAttach0
local Casing = CasingEffect.Casing
local CasingAttach = CasingEffect.CasingAttach
local CasingAttach0 = CasingEffect.CasingAttach0

local function PlayAnimation(animation)
if animated then return end
animated = true
local track = animation:FindFirstChildWhichIsA(“AnimationTrack”)
local anim = character:FindFirstChildWhichIsA(“Animation”) or Instance.new(“Animation”)
anim.AnimationId = “rbxassetid://”…tostring(track.Animation.AnimationId)
local play = character.Humanoid:LoadAnimation(anim)
play:Play()
play.Stopped:Wait()
animated = false
end

local function CasingShoot()
local part = CasingAttach0:Clone()
part.Parent = workspace
part.CFrame = CasingAttach0.CFrame
game.Debris:AddItem(part,0.5)
end

local function MuzzleShoot()
local part = MuzzleAttach0:Clone()
part.Parent = workspace
part.CFrame = MuzzleAttach0.CFrame
game.Debris:AddItem(part,0.5)
end

Casing.Touched:Connect(function(part)
if part.Name == “Frame” then
CasingShoot()
Casing.Transparency = 1
wait(0.1)
Casing.Transparency = 0
end
end)

tool.Reload.OnClientEvent:Connect(function()
PlayAnimation(M1911insertMag)
end)

tool.Casing:Connect(function()
PlayAnimation(CasingEffect)
end)

tool.M1911insert:Connect(function()
PlayAnimation(M1911insert)
end)

tool.M1911SlideRelease:Connect(function()
PlayAnimation(M1911SlideRelease)
end)

tool.Activated:Connect(function()
if not animated then
PlayAnimation(M1911Slide)
MuzzleShoot()
wait(0.1)
Muzzle.Transparency = 1
wait(0.1)
Muzzle.Transparency = 0
end
end)

I found out that the animation don’t work because the roblox idle animation overwrite it
to fix it you have to had a keyframe of every part of in idle animation or the default roblox idle animation will overwrite it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.