[Solved] How can i change the animation after taking an object?

Hi, I have a small problem, I’ve been trying to solve it myself for a long time but I can’t, I’ve also searched on yt or in other places but I haven’t found anything to help me. What I want to do is to change the animations of the character after picking up a specific object, I mean the state animation and the walking animation should be different, is it possible? I want to do this because after my character takes an object I want him to have other clothes.

You’ll have to add the new animations first. Then in the events, use the set animation action to change the animation.

If you switch animations based on an action (idle, run, jump etc), then you may need to set object variables that keep track of the current animation for each state.

I tried to do this but there is a small problem, everything works fine but the walking animation doesn’t, it doesn’t go in a loop even though I checked it.

Can you post all the events that change the animation?

I gave a variable to the object that takes it (ou) because I needed it.

Then I took advantage of the variable to change the animations. The idle animation works fine, but when it moves it doesn’t loop, just the first frame of the walking animation.

“stat” is idle animation
“mers” is walking animation
“ou” is the new idle animation
“ou mers” is the new walking animation
(sorry for putting words in my language, from now on I will only put in English for problems like this)

The usual culprit for this behaviour is that the animation is getting reset somewhere else before being set again in the events you have posted. Are there any events that set pui’s animation to “mers”?

It looks like it will be constantly setting the animation, unless you changed the variable OU back to 0 somewhere else. Just looking at this piece however, as soon as conditions are met, it will be setting animation to “ou mers” every tick (starting it over)

This is the only thing that changes the main animation.

I keep looking at the code now and I keep trying to change things but it doesn’t work, I always get the same result.

edit: I tried something and it worked. Thank you all!