Is it possible to create/play an animation with a script?

You know about that model in character rigs called “AnimSaves”? Well, I want to know if it’s possible to make a script that will just play those animations directly without me having to export them to the Roblox website.

In addition to that, I also want to know if I can use a script to both generate and play an animation. If so, what do I need in order to do it?

2 Likes

CFrames

2 Likes

There is a function known as LoadAnimation

It allows you to play animations, you need to provide it the animation Id

Here is an example:

local Animation = "Insert your AnimationId here"
local Character = game.Players.LocalPlayer.Character

Character.Humanoid:LoadAnimation(Animation):Play()

Its better to do it on the client since you have more access to the player than the regular script.

In order to play the animation:

1 Like

But animations made by other players will not play.

2 Likes

@Sorditor
You pretty much need your own animations for it to run, or at least export the animation, there isnt a way to Play them without exporting them, you have to in order to even play them.

If youre in a Group game, create the animation for the Group

If youre in your own game, create it on your account

AnimSaves are just the saves of your animations so you can animate them. Not play them, youll need to export, like i said.

To Load and Generate the Animation, you use LoadAnimation, to play the animation, you add :Play() to it

You can manually use the keyframes and play them. You will need to dig deep into the API for this though.

1 Like

Its probably better to use AnimationId

1 Like