#Gun Idle Animation isnt working
83 messages · Page 1 of 1 (latest)
basically
i have a code which works perfectly except for the fact that the idle animation isnt working
the firing animation for the gun is working fine
i even messed around with the code and the result was the idle animation was playing non stop even when i unselected the gun/tool
and the firing animation didnt work
then i put the code back to normal
so what should i do so that the animation of idle is below the priority of the firing one?
just know i published the idle animation to roblox in priority action3
where is the code
wat i was tryna say is
the code is fine
but i will send it anyway
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local tool = script.Parent
local idleAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.IDle)
local shootAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.Fire)
tool.Equipped:Connect(function()
game.ReplicatedStorage.ConnectM6D:FireServer(tool.BodyAttach)
char.Torso.ToolGrip.Part0 = char.Torso
char.Torso.ToolGrip.Part1 = tool.BodyAttach
idleAnim:Play()
end)
tool.Unequipped:Connect(function()
game.ReplicatedStorage.DisconnectM6D:FireServer()
idleAnim:Stop()
end)
tool.Activated:Connect(function()
shootAnim:Play()
end)```
if the script is fine then it isnt a scripting problem
;-
and you should load animation on animator instead of humanoid
sorry what/
ooh
lemme try
local idleAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.IDle)
local shootAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.Fire)
ok so here
yeah
local idleAnim = char:WaitForChild("Humanoid")Animator:LoadAnimation(script.IDle)
local shootAnim = char:WaitForChild("Humanoid")Animator:LoadAnimation(script.Fire)
like this?
i did that
ok now so erm
the idle animation still isnt working.
but the firing is working fine
wat is bro typing
local tool = script.parent
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChild("Humanoid")
local Animator = Humanoid.Animator :: Animator
local Anim = script.IDle
local IdleAnim = Animator:LoadAnimation(Anim)
tool.Equipped:Connect(function()
IdleAnim:Play()
end)
tool.Unequipped:Connect(function()
IdleAnim:Play()
end)
i do prefer make it like this
this is my way to get the animator and load an idle anim
for Humanoid i use FindFIrstChild()
its still not working welp 😭
the animation Instance have the animation id pasted in?
yeah
like rbxassetid://123456
** You are now Level 3! **
this is what happens when i delete
game.ReplicatedStorage.ConnectM6D:FireServer(tool.BodyAttach)
char.Torso.ToolGrip.Part0 = char.Torso
char.Torso.ToolGrip.Part1 = tool.BodyAttach
for this
the idle animation is stuck for whole time even when the tool is unequipped AND the firing button is completely not working
i've a question
aight
local script
aight bet
isually
we do attach the models or stuff like that in the server
coz that will be just for the client user
then just delete the
keep the fireserver
k
in the script where it will receive the fireserver, attach the tool or idk what you're trying
this
and if not working
then re-type code
i will try in a few min
i deleted this and kept the fire server
is it because the idle animation is set to a particular priority?
i will do all this later
i gtg
i just added a reloading animation and it works perfectly when i press R
nice