Animation Override while holding a tool

I am trying to make my own sword for a game I am working on, I have the model finished along with it actually being a tool, what I want to do now is to make it feel a lot better on the character by overriding default animations I have set into the game and put in new ones that would fit the sword. how would I do this? I looked on dev forums and online and only found something on dev forums I couldn’t understand. So how would I make this work

Animations have a priority to when they override, you can change the property on the default Animation Editor plugin here, by pressing the 3 dots.

Action is the highest and will always override, generally the one you should use.

image

6 Likes

is there anything I would have to write to get this to work, just because it has priority would I put this in the animation script a local script in the sword or

Basically you need 3-4 animations for override the original from roblox, a idle animation (default when holding a tool), a equip animation (when you equip the tool) , a desequip animation ( ‘’ desequip your tool) and the mouse button animation (when you make a action with the tool, like attack move)

For that, you first need copy the animate script (play on studio>go to your character on workspace>copy)
transferir

After that ,paste the script on StarterPlayer>StarterCharacterScripts, and remove the original tool animations
Screenshot_2

Finished that you now able to replace your custom animations,create a local script inside your tool and make the script to work with animation priority like this one:

7 Likes

It says that all the h’s in h:LoadAnimation are not defined and plr is not defined
how should I define plr and h?

plr is LocalPlayer and h is Humanoid from it.

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:WaitForChild("Humanoid")
1 Like

Thank you a lot! Though I am concered, why do I get this in output
Workspace.EvanNicholasRBLX.Animate:438: attempt to index nil with ‘totalWeight’
is this for the regular roblox animation script?

also one more thing, when using a custom run animation and walking with it out, it locks the idle in place do you know how to fix that -
edit 2 : fixed that on my own

1 Like