#Animations somehow stop after I unequip the tool.

89 messages · Page 1 of 1 (latest)

mighty cove
#

Hello I'm using a script where I unequip the gun,It seems to make a pose which doesn't have any kind of animations but the character standing,may someone help?

Problem :

terse marlin
#

you use custom settings to setup the animation of gun walking which probably breaks the original animation script

#

@mighty cove

#

ur anims conflict

#

and the way you play them

mighty cove
#

May I send the script

#

so you can better examine it

#

If you can understand

terse marlin
#

ok

mighty cove
#

Like you see,when I unequip the gun

#

I actually stop all playing walkanims

#

I actually tried it,and yet that happens,as I showed here

terse marlin
#

Ok lemme see

#

also i noticed your character only cast a shadoww after equipping and unequipping a gun

mighty cove
#

my bad

terse marlin
#

do you load like a custom character or anything

mighty cove
mighty cove
#

No,I doN't

#

That's normal roblox rig

terse marlin
#

ok lemme check this

mighty cove
mighty cove
#

Like change Animate's Animations

#

like make changes on them

#

anyways

terse marlin
#

your code needs some work

mighty cove
#

I know right,It's so messed up

terse marlin
#

and your use of the typechecker is redundant

mighty cove
#

Hold on sending Module Script's equip and unequip functions

terse marlin
mighty cove
terse marlin
#

you dont need to run type(Track) because the function expects a string

mighty cove
#

That's why I was using type

#

Anyways function is wrong in any way

terse marlin
#

Okie

#

Im stil looking

mighty cove
# mighty cove

Just look at the parts where It has "Animations_On" boolean as True

#

others are not included with it

terse marlin
#
Remote.Event_024.OnClientEvent:Connect(function(Animator : Animator,Track : string | {},NecessaryAnimTable : {}?)
    
    local AnimTracks = Animator:GetPlayingAnimationTracks()
    
    if type(Track) == "string" then
        
        for _,AnimTrack : AnimationTrack in AnimTracks do
            
            if AnimTrack.Animation.Name == Track or AnimTrack.Animation.Name:find(Track) or AnimTrack.Animation.AnimationId == Track then
                
                AnimTrack:Stop()
                
                AnimTrack:Destroy()
                
            end
            
        end
        
    elseif type(Track) == "table" then
        
        for _,AnimTrack : AnimationTrack in AnimTracks do
            
            for _,val : string in Track do
                
                if val == "WalkAnim" then
                    
                    if AnimTrack.Animation.Name == val and NecessaryAnimTable then

                        AnimTrack.Animation.AnimationId = NecessaryAnimTable[val]

                    end
                    
                elseif val == "Animation1" then
                    
                    if AnimTrack.Animation.Name == val and NecessaryAnimTable then

                        AnimTrack.Animation.AnimationId = NecessaryAnimTable[val]

                    end
                    
                elseif val == "Animation2" then
                    
                    if AnimTrack.Animation.Name == val and NecessaryAnimTable then

                        AnimTrack.Animation.AnimationId = NecessaryAnimTable[val]

                    end
                    
                else
                    
                    AnimTrack:Stop()

                    AnimTrack:Destroy()
                    
                end
                
            end
            
        end
        
    else
        
        error("Type invalid!")
        
    end
    
end)``` is this where you stop all anims?
#

or here

Remote.Event_023.OnClientEvent:Connect(function(Animator : Animator)
    
    local AnimnTrackList = Animator:GetPlayingAnimationTracks()
    
    for _,AnimTrack : AnimationTrack in AnimnTrackList do
        
        if AnimTrack.Animation.Name:find("Animation") or AnimTrack.Animation.Name:find("Anim") then
            
            AnimTrack:Stop()
            
            AnimTrack:Destroy()
            
        end
        
    end
    
end)
mighty cove
#

Alright so

#

You see Event_024?

terse marlin
#

ya

mighty cove
#

That meant to stop all animations,except WalkAnimation's animationid

#

to prevent the thing which was happening in the video I have sent

#

But,It seems It didn'T change anything.

terse marlin
#

Ahhhh so you directly change the animation under the Animate of the player?

mighty cove
#

Yeah

#
                if val == "WalkAnim" then
                    
                    if AnimTrack.Animation.Name == val and NecessaryAnimTable then

                        AnimTrack.Animation.AnimationId = NecessaryAnimTable[val]

                    end
mighty cove
#

to prevent it

terse marlin
#

hm

mighty cove
#

I'm not really depth on roblox api but yeah.

terse marlin
#

you dont have to change the whole walk animation, since roblox by default puts one arm up. just run a viewmodel of two arms if need be and have to in holding the gun position instead of changing the animation

#

just load and unload these "arms" when they equip a gun

mighty cove
#

which part?

#

I didn't understand well.

#

Like

terse marlin
#

idk how t o explain this

#

you just want 2 or even one arm to replace the characters real arm and hold them in place with constraints. just make the actal arms transparent so scripts dont break. when they de-equip the gun, make the arms transparent/move them back or whatever

mighty cove
#

Okay,so.

#

I want to know one more thing

#

Am I forced to do changes to Animation like stop or change It's animation id through Server Side?

#

for to make it show up on server

#

or just the client?

terse marlin
#

when changing animations i suggest handling it on the server becaues its less restricted and you can also stream to all client

mighty cove
#

So no need for

#

@terse marlin So no need for the animation handler which is a local script?

terse marlin
mighty cove
#

@terse marlin

#

I forgot to mention that Anims do collide on server side when I try the server side option

#

Weird results like this

terse marlin
#

Thats because on the client you stop the animations but not on server

mighty cove
#

Ahhhh

#

So I stop the animations from client?

#

But I launch them from server

#

If that's what you meant

terse marlin
#

On the server the animations collide because you only change the original ones on the client and not on the server

#

If the collisions are an issue then just handle the changes on the server

mighty cove
#

If someone could still help,It would be nice

#

It seems your solution didn't work,I tried to stop them both

#

client and server