Is it me or roblox's animation replication is terrible?

I’m currently making a roman empire sword/combat system and trying to use raycast hitbox for the swords, I’ve asked and searched and found no solution, basically when you charge it would play an animation then stop (speed adjusted to 0) then on release it would let go and activate the raycast on the sword, but animation works on client, except its completely different on server.

https://gyazo.com/7e3e65c0ac59ac6bb77d859993fca0e0

Here is some related lines of code:

-- hold down detection
if not stunned then	
			cd = time()
			held = true
			while held and LoopDebounce == false do
				local sDt = time() - cd
				print("held")	
				wait()
				if sDt > 0.3 then
					LoopDebounce = true
					if SwordState.Value == "Q" then
						print("charging Q")
						status = Status.Charging
						IdleTrack:Stop()
						QAttackTrack:Play()
						wait(0.2)
						QAttackTrack:AdjustSpeed(0)
-- when you let go
elseif status == Status.Charging then
			if SwordState.Value == "Q" and not BlockingState.Value and debounce == false and stunned == false then
				print("charged Q")
				debounce = true
				Request = "LongSword"
				QAttackTrack:AdjustSpeed(1.5)
				WeaponEvent:FireServer(UpperIron,Character)
				wait(CoolDowns.AttackingCooldown)
				IdleTrack:Play()
				LoopDebounce = false
				debounce = false

Both are client btw

4 Likes

Did you make any progress with this issue?

I faced a similar one.

By switching playing the animations on the server I could get it to replicate more consistently to all clients. (Didn’t want to do this cause it’ll make the animations less responsive for the user)
But even with this solution, it still fails to replicate sometimes.

Hey @NukemDukeForNever,

The code and preview are pretty outdated considering it uses Humanoid:LoadAnimation and not the Animator instance, I also had crossed them out. After coming across other instances that required the same behavior (reliance on animations for RaycastHitbox) it seems generally Roblox has improved their animation replication over time so your issue isn’t similar to mine

I came across a post of Roblox about improving their animation API not too long after I started facing this issue

However, I will ask you to provide me with more context like: what are you trying to animate? and why on the server when client-loaded animations replicate for characters?

1 Like

Similarly to you I was using :AdjustSpeed() to freeze and resume melee combat animations. I play the animation. Freeze it. Play it. Then Freeze it again before letting it finally play out. I also used tick() and runservice to do the timing for when the animation should stop or start.

The problem is that the freezing and resuming of the animation doesn’t replicate to other players consistently. Sometimes it stops then resumes later than it should or freezes sooner than it should. When running the animations from the melee user’s client the delay is more frequent and more apparent than when I changed to running it from the server, but even on the server the delays still happen from time to time.

I think this reply to a post here

describes my problem pretty accurately, and it seems like there isn’t a solution to get the animations to behave perfectly on time unless I control the freezing and playing of the animations on each observer’s client.

It seems that unfortunately, this inconsistency is Roblox’s fault, and the alternative needs thorough interpretation in order to apply

I’m not familiar with the alternative you referenced, I completely changed my approach when it came down to combat animations as it no longer relies on freezing them, I instead use Animation Events which I recommend

You can create a local variable and then when you press the button change the variable to true and then when you release the button change it to false. Then whenever you’re moving your character you can use the variable as a check for if your sword is out or not.