So I’ve made some animations for my game and I want people to have normal animations when in the lobby and when the round starts the animations switch for everyone except “the Hunter”. Seems pretty easy to do, just not sure where to start. Any help appreciated
make copy of Animate script (script that every player gets upon playtesting so just ctrl+c ctrl+v it)
And edit animation values in that.
and give each player respectful copy of said script; alternatively you can just hardcode this behavior into animate script.
alright, so are you suggesting I take the animate script and put it in the replicatedstorage, so every time the round starts it fires a remote event which copies the animate script to the player and replaces the original one? That could work but just need to figure out how to copy the animate script only for players and not for the hunter.
I believe they are suggesting that you should copy and paste the Animate script in every character then place it in StarterCharacterScripts, if you clone a script it will not run as they only run at runtime.
You can do that locally as a client.
There no need of doing so on server.
What? Or save yourself the hassle and just copy and paste the Animate script from the Character to StarterCharacterScripts and change the values you need?
I would do that but I don’t want the same walk animation as in game, and have the hunter with seperate anims. I guess I could copy the animate script and make a remoteevent that triggers something in the script to change animations
I would use an IntValue called AnimId, copy the script then reference the Walk Animation as this
local WalkAnim = "rbxassetid://"..path.to.AnimId.Value
-- Will be used later
path.to.AnimId:GetPropertyChangedSignal("Value"):Connect(function()
local newValue = path.to.AnimId.Value
WalkAnim = newValue
end)
Then if the player is a hunter switch that value
path.to.AnimId.Value = 00000000
Then after that in the original animate script we need to make a hacky way of doing it to update. as shown in the first script
There are other ways to do this such as creating your own Load Animations script then changing the Walk values in Animate script to nothing so they don’t play and you’ll just glide, then load the animation if they are a hunter or player upon selecting the class.
You don’t even need to make a copy of the Animate script (it can be rather bulky) , but just use any local script that can play an animation, have it detect when a player is in the round and not the hunter and play the custom animation at a priority higher than the other animations like “Action2”, then also have it detect when the player is not in a round, and have it stop playing the animation.
I like to have the server set an Attribute for this, and have the client script check for that attribute change.