Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/animations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@quenty/baseobject": "file:../baseobject",
"@quenty/enumutils": "file:../enumutils",
"@quenty/humanoidanimatorutils": "file:../humanoidanimatorutils",
"@quenty/instanceutils": "file:../instanceutils",
"@quenty/loader": "file:../loader",
"@quenty/maid": "file:../maid",
"@quenty/promise": "file:../promise",
Expand Down
13 changes: 8 additions & 5 deletions src/animations/src/Shared/AnimationSlotPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ local Maid = require("Maid")
local Promise = require("Promise")
local PromiseMaidUtils = require("PromiseMaidUtils")
local RbxAssetUtils = require("RbxAssetUtils")
local RxInstanceUtils = require("RxInstanceUtils")
local ValueObject = require("ValueObject")

local AnimationSlotPlayer = setmetatable({}, BaseObject)
Expand Down Expand Up @@ -323,15 +324,17 @@ function AnimationSlotPlayer.Play(
end
end)

if not track.Looped then
-- This is a hack to ensure that animations stop at a set rate instead of roblox's weird default faded time
maid:GivePromise(AnimationPromiseUtils.promiseLoaded(track)):Then(function()
-- This is a hack to ensure that animations stop at a set rate instead of roblox's weird default faded time
maid:GivePromise(AnimationPromiseUtils.promiseLoaded(track)):Then(function()
maid:GiveTask(RxInstanceUtils.observePropertyBrio(track, "Looped", function(looped)
return not looped
end):Subscribe(function()
-- This is very very sad...
maid:GiveTask(task.delay(track.Length - track.TimePosition - 2 / 60, function()
track:Stop(fadeTime or self._defaultFadeTime.Value)
end))
end)
end
end))
end)

maid:GiveTask(function()
local stopFadeTime = fadeTime or self._defaultFadeTime.Value
Expand Down