wastbo
(DanCodes)
March 4, 2024, 3:41am
#1
I’m having an issue stopping/playing animations on the server. It just looks very laggy sometimes
Here’s a video of the issue:
[Watch 2024-03-03 21-32-09 | Streamable ]
Here’s the current script for playing the animations: (it’s messy, I know)
local function OpenDoor()
leverAnimations.Up:Play()
leverAnimations.Down:Stop()
leverAnimations.DownIdle:Stop()
leverAnimations.Up.Stopped:Wait()
leverAnimations.UpIdle:Play()
doorAnimations.Open:Play()
doorAnimations.Close:Stop()
doorAnimations.CloseIdle:Stop()
doorAnimations.Open.Stopped:Wait()
doorAnimations.OpenIdle:Play()
DoorChanging = false
end
local function CloseDoor()
leverAnimations.Down:Play()
leverAnimations.Up:Stop()
leverAnimations.UpIdle:Stop()
leverAnimations.Down.Stopped:Wait()
leverAnimations.DownIdle:Play()
doorAnimations.Close:Play()
doorAnimations.Open:Stop()
doorAnimations.OpenIdle:Stop()
doorAnimations.Close.Stopped:Wait()
Shake:FireAllClients("Explosion")
doorAnimations.CloseIdle:Play()
DoorChanging = false
end
wastbo
(DanCodes)
March 4, 2024, 4:12am
#3
I don’t know how to make the video an embed, but it plays the animation and everything is loaded, but it just looks glitchy. It’s on the server because I need it to be visible to all players (not a humanoid) it’s a door with an animation controller
last time I checked, animations replicated from the client.
wastbo
(DanCodes)
March 4, 2024, 4:15am
#5
It’s not being handled by a client, it’s a door that anyone can interact with
Yes, but you can tell the client to hire an animation when fired.
wastbo
(DanCodes)
March 4, 2024, 4:20am
#7
The client does not own it therefore I don’t want to play it on the client
wastbo
(DanCodes)
March 4, 2024, 4:23am
#8
Please read up on stuff before telling people what to do
The sliding door animation looks smooth in the video?
Do you mean the brief glitch that’s visible with the door?
I assume you have the animations preloaded?
wastbo
(DanCodes)
March 4, 2024, 4:57am
#10
Yes, I load the animations when the game starts, then I play them
wastbo
(DanCodes)
March 4, 2024, 4:58am
#11
I think the glitch has something to do with the pause between stopping and playing the animations
What if you try
task.wait(leverAnimations.Down.Length)
Instead of the Stopped event.
wastbo
(DanCodes)
March 4, 2024, 5:25am
#13
It’s not that part that’s bugging, it’s whenever I start the animation. Currently it starts the close/open animation for the door, then stops the opposite anima
Oh sorry I meant
task.wait(leverAnimations.Down.Length - 0.1)
So it calls play on the other one a bit sooner.
I’m not sure what you mean though.
wastbo
(DanCodes)
March 29, 2024, 6:55pm
#15
I figured out how to fix this. The animations weren’t loaded yet on the client, so when an animation played there was a delay for loading. I just added it to ReplicatedStorage so my loading screen included them.
system
(system)
Closed
April 12, 2024, 6:56pm
#16
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.