r/roblox•
direMitten

Getting animations to last forever?

Help

I'm trying to get a character to pick something up when they press 'F', and drop it when they press 'F' again. For this I want their arms to go into a certain position. I have three animations for this: one that makes their arms move from their vertical position along their body to holding their arms in front of them, one that is just a single keyframe with their arms in front of them, and one that is the opposite of the first. I want the single keyframe one to "last forever", or at least until the character drops the thing again (i.e. until I tell it to stop).

I've read somewhere that I could use AnimationTrack:AdjustSpeed(0) to make it last forever. This sorta works, but not very well. Sure it pauses the animation, but also all of the default animations like walking. This is not what I want. I want the character to hold their arms in front of them, but I also want their legs to move when they walk.

I tried modifying the default Animation script, and I've almost got it working. The player plays the pick up animation, and when it ends, the holding animation starts. When the player drops the thing, their arms go back to idle position. But if something else triggers an animation (like walking or jumping), then the holding animation stops. Additionally, if the holding animation runs out of time before it's interrupted, it will also stop and revert to the idle animations.

Can anyone help me with this?

Posted Feb 16, 2017, 10:49 PM UTC

24
Loading comments…