You can write your topic however you want, but you need to answer these questions:
When a character is loaded, roblox creates a LocalScript called Animate. I want to customise that system by adding different states such as crouch for example, as well as replace default idle and walk animation.
I don’t know where this Animate LocalScript is coming from and I don’t know how to write over it to essentially replace it with my own script.
Found some posts about how to change walk and idle animations, but these solutions don’t allow me to use my own version of the Animate script.
Here is an elaboration of why I even want to do this. Because I have crouching and proning, it’s not ideal for me that walking and idling is managed by an entirely different script. This mix up caused some unexpected behavior in my script, and the Animate script, because to Animate script the character is just standing and idle, not crouching or proning.
P.S. I have little knowledge implementing animations so if my logic is flawed please feel free to tell me
Thank you very much.
Sidenote:
I just looked over the script, there is this part
-- emote bindable hook
script:WaitForChild("PlayEmote").OnInvoke = function(emote)
-- Only play emotes when idling
if pose ~= "Standing" then
return
end
if emoteNames[emote] ~= nil then
-- Default emotes
playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
return true, currentAnimTrack
end
-- Return false to indicate that the emote could not be played
return false
end
but I couldn’t find where this bindable function is used. Do you know anything about how this bindable is used?
You can also copy an Animate script from a character rig and put your own animations into the animation instances to the script and in table of the script.
Yeah I saw the table and was thinking that, though I am worried about some of the things in the table. For example there is a running animation that is somehow connected to Humanoid.Running event, but I’m not even sure how the humanoid knows when it’s running. And I can’t find any specific information on this either.
Yeah I saw that. Upping the walkspeed does not activate the Running event. You probably are better using your own script that changes the animations. That would also make things like running animations and others easier to incorporate.
After a bit of testing it seems that running event fires when humanoid starts moving? Before I’d use Humanoid.MoveDirection ~= Vector3.new(0,0,0) but this might be a better way. It also passes the current walkspeed when the event is fired so I guess the name is just misleading, and actually represents moving.