Default Animation Help

I have an animation that plays when the player activates a tool. Prior to them activating the tool the tool is idled in the ‘toolnone’ animation (the default idle tool animation). However, after activating the tool and playing the custom animation the ‘toolnone’ animation no longer plays. I suspected this might be because the custom animation isn’t integrated into the default ‘Animate’ script, which means that the custom animation might block default tool animations after its use. I tried integrating the animation into the ‘Animate’ script but that didn’t play the animation at all. I have also considered looping the toolnone animation until the action is required again, but this doesn’t seem like a good solution.

-- Replace the old animate script with the custom animate script
char:FindFirstChild("Animate"):Destroy()
local playerAnimate = repStor.Modules.Animate:Clone()
playerAnimate.Parent = char

--In the initial table
toolcustom = {{ id = "http://www.roblox.com/asset/?id=7418788524", weight = 10}}

--AnimateTool function
function animateTool()
	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
		return
	end
	if (toolAnim == "CustomAnim") then
		playToolAnimation("toolcustom", 0, Humanoid, Enum.AnimationPriority.Action)
	end
end

-- In the server script that calls the animation
local str = Instance.new("StringValue")
str.Value = "CustomAnim" 
str.Name = "toolanim"
str.Parent = Tool

I also put a stringvalue in the animate with an animation instance childed, although I’m not sure whether this was necessary.
Screenshot 2021-09-09 at 22.12.00

Note: I’m not sure whether this method of editing the animate script is preferable, and I think that it would be better if someone could suggest an easy alternative solution.

Editing the Animate script is a fine thing to do.

There are other ways you can change the default animation. You could use the game settings or use a Humanoid Description.

You could also have a script at runtime that does this too.

Could you explain how I could implement this properly?

I’m pretty sure these methods (or at least the former) will only effect the standard animations, rather than any custom animations I have for custom actions/tools in my game. This does raise an issue with using the ‘Animate’ script method, though, since it might disable the ability for players to have non-default animations equipped on the Roblox website.

I found that the problem is solved if you add the StringValue creation code to the client instead, which isn’t ideal for my situation. If anyone knows of any way to initiate the Animate script from the server it would be very useful.

This thread will help you:

That’s definitely helpful. Thanks. Do you know any way of triggering the Animate script from the server? i.e via the creation of a new string value.