Switch Animations Mid-Game [2.5D Fighting Game]

Hello Everyone! I am writing to ask about changing animations mid-game.

Why?

I am making a 2.5D fighting with custom idle animations and here is what it’s like so far:

As you can tell I don’t want the players backside to be showing.

What have you done yet?

So at first, I tried having a custom value to store animation Id’s, and modify the default Animate script to have a .Changed feature (just for testing)

Here is the modified code:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

-- humanoidAnimatePlayEmote.lua

local Figure = Character
local Torso = Figure:WaitForChild("Torso")
local RightShoulder = Torso:WaitForChild("Right Shoulder")
local LeftShoulder = Torso:WaitForChild("Left Shoulder")
local RightHip = Torso:WaitForChild("Right Hip")
local LeftHip = Torso:WaitForChild("Left Hip")
local Neck = Torso:WaitForChild("Neck")
local Humanoid = Figure:WaitForChild("Humanoid")
local IdleId = Figure:WaitForChild('IdleId')
local pose = "Standing"

IdleId.Changed:Connect(function()
	script.idle.Animation1.AnimationId = IdleId.Value
	script.idle.Animation2.AnimationId = IdleId.Value
end)

What’s the issue?

The actual animation changes take effect perfectly CLIENT SIDED ONLY
(Reference Image):
image

But in the server:
image

How can I have the desired effects but replicate it to the server?

2 Likes

I am not quite sure what causes the issue but maybe try stopping the animation and then playing the new one

Animation:Stop()

1 Like