[v1.2.1.1] BetterAnimate (R15, R6, Skinned & Custom Rig Support)

BetterAnimate works like original Animate, but have more functionality


Introduction

As you know, when a player’s character spawns, Roblox creates an inside character script called “Animate”. This script contains information on how characters’s animations should work.
But roblox’s animate script logic and code looking is kinda bad (really bad).

Thats why I decided to rewrite everything


Why BetterAnimate is better?

R15, R6, Skinned & Custom Rig Support

Script automaticly determines which animations should be used for the character by checking Humanoid.RigType


Play custom tool animation

How to use custom tool animation:

local TransitionTime = 0.1
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://507768375"

local MyAnimator = BetterAnimate.New(Character)
MyAnimator:PlayToolAnimation(Animation, TransitionTime)

P.S Animation Instance will NOT be deleted


Disable Toolnone animation

To disable Toolnone animation (default animtaion when player equip tool), you need to:
Tool:SetAttribute("NoToolNone", true)
OR
Tool:AddTag("NoToolNone")

P.S: You can change Attribute and Tag name that need to check in Settings


Tool speed glitch fix

When you equip tool while emoting your сenter of character mass changes and let to move really fast while jumping (example), with this Animate script it no longer possible

Thanks to @treebee63


Optimized

BetterAnimate using custom timer logic with only 3 event connections:
Humanoid.StateChanged, Character.ChildAdded, Character.ChildRemoved


Inverse animations

To enable this you must set in Settings of BetterAnimate Enabled_Inverse = true

local MyAnimator = BetterAnimate.New(Character, {
	Enabled_Inverse = true
})

-- OR

MyAnimator.Settings.Enabled_Inverse = true
Class_Inverse = { -- Determines what classes have this feature
	Walk = true, 
	Run = true, 
	Swim = true,
	Climb = true,
},

InverseOn = { -- Determines in which direction the inversion will work
	BackwardRight = true, 
	BackwardLeft = true, 
	Backward = true,
	Down = true, -- For climb
},

Update animations in real time

How to use:

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://507768375"

local TestMyAnimations = {
	Idle = {
		Idle1 = {ID = 1132473842, Weight = 1000},
		{ID = 1132477671},
	},

	Toolnone = {
		Toolnone1 = {Instance = Animation}
	},

	Run = { Run1 = {ID = 1132494274, Weight = 10} },
	Walk = { Walk1 = {ID = 1132510133} },
	Swim = { Swim1 = {ID = 1132500520} },
	Swimidle = { Swimidle1 = {ID = 1132506407} },
	Jump = { Jump1 = {ID = 1132489853} },
	Fall = { Fall1 = {ID = 1132469004} },
	Climb = { Climb1 = {ID = 1132461372} },
}

local ResetClass = true -- Means that the current class animations will be deleted

--[[
** NOTE **
if ResetClass = false it will add animations, 
and if found animation with similar index (For example Fall1),
it will be replaced with new one
]]--

local MyAnimator = BetterAnimate.New(Character)
MyAnimator:UpdateAnimations(TestMyAnimations, ResetClass)

Signals

BetterAnimate have 4 Signals:

local BetterAniamte = require(PATH_TO_MODULE)
local MyAnimator = BetterAnimate.New(Character)

 -- Fires on new state (Running, Falling, etc...)
MyAnimator.Signal_NewState:Connect(function(State: string) end)

-- Fires on new animation (Except tool animation)
MyAnimator.Signal_NewAnimation:Connect(function(AnimationClass: string, AnimationName: string, AnimationTable) end)

-- Fires on new **(String not Vector3)** moving direction
MyAnimator.Signal_NewDirection:Connect(function(Direction: string, Vector3_Direction: Vector3) end)

-- Fires on animation keyframe reached (Including tool animation)
MyAnimator.Signal_KeyframeReached:Connect(function(Keyframe: string) end)


Debug

BetterAnimate has a built-in debug that can be activated at any time to check the status

local Enable = true -- or false
local MyAnimator = BetterAnimate.New(Character)
MyAnimator:EnableDebug(Enable)

How to setup
local BetterAnimate = require(--Path_To_BetterAnimate--)
local InitSettings = {} -- You can change it later in MyAnimator.Settings

local MyAnimator = BetterAnimate.New(Character, InitSettings)
MyAnimator:Start()

Q&A
How to get & play avatar animations?
local LocalPlayer = game:GetService("Players").LocalPlayer
local BetterAnimate = require(PATH_TO_MODULE)
local AvatarAnimations = BetterAnimate.GetAvatarAnimationsByUserID(LocalPlayer.UserId)
local MyAnimator = BetterAnimate.New(Character)
MyAnimator:UpdateAnimations(AvatarAnimations, true)

You can get module from GitHub

Module

Or download open source place (Recommended)

Place

Feel free to give feedback

63 Likes

I kinda like what you done here. Might be useful for people who are looking to have a more simple animated script. But my tip is to try and make this work for all avatar sizes as Roblox animated script works on all avatars.

1 Like

My version supports this too, simply it is a modified version of the script from Roblox

2 Likes

Calling /e dance without number argument instead of playing random animation throw error
изображение
изображение

3 Likes

P.S.
You have emotes listed in a dictionary, and it missing dance without number
изображение
and in function PlayRadnomDance


you checking that it it a “dance”

3 Likes

Thanks for report, fixed in new version!

1 Like

Could you please try to improve the R6 Animate script while you’re at it?
That would be nice for my game.

1 Like

Only If I have free time, reading scripts from Roblox is a pain

1 Like

If you tried your 8 directional animation with original “Animate” script then it should work

1 Like

Can we have an animation playground game? I’m usually on Mobile and sometimes I don’t have the time to check things on my laptop. Thanks.

Sure, I’ll do it when I finish the new version

1 Like

I’ve been looking for something to specifically fix animations not updating in real-time when they’re changed at runtime.

I’d use this but I noticed things like the point / wave animations not playing when running the chat commands.

I’d love to use this if it was fully complete, hoping the new version fixes some of these things.

1 Like
3 Likes

Does this script replicate the default animations that are overwritten? When using the default animation script, it’s inconsistently replicated.

Do you mean playing 2 animations at once (For example: old walk and new updated walk in real time)?

Answer: No.

This is impressive!
I like the playing animation backwards feature and the change animations in real time.

There are some Suggestions and Bugs I have for you.

Bugs:
  1. When jumping while moving backwards, Animation might play backwards and trigger the fall animation too early which messes up the look of it.
  2. If the humanoid is swimming backwards it bugs the animation out and loops it (Depends on animation)
  3. There are a lot of type checked code bugs that are present if “–!strict” is present
Suggestions
  1. Make a settings module to enable and disable extra features
  2. Use the base of the animate script I will provide for cleanliness and such
  3. Set animations on client and/or server for the benefits that come with it

Animate Script:
CustomAnimate.rbxm (8.6 KB)

Essentially, all it is is just a Animate script that relies on modules and a controller to be more clean and efficient.

3 Likes

Update 1.1.4.1

Fixed reversed animations
Removed --!strict
Fixed emote animations randomly can stop playing
Added settings sections (Image below)
Removed folder creating when changing animation in real time

3 Likes

Hello, thanks for bug reports!
About your suggestions, its a good idea, but i currently have no plans for it.
I have an idea in my head about how this could work, and it’s a lot of work for me.

The example you showed is not very good in that all these modules are replicated when the character respawns

2 Likes

Your right, but the general idea is just more organization and whatnot.

Good update though! I like it

2 Likes

After a while, I realized that I was doing some kind of garbage, I already have an idea in my head on how to simplify and improve everything. It will also work as a module (no longer 2 different scripts: server & client)

But! My module will use another module, for simplicity: Trove

New update coming soon!

5 Likes