Animation.TimePosition VS Task.delay

Hello, I’m looking for the most efficient way to synchronize VFX with animation and SFX, preventing delays caused by lag. In the context of a battlegrounds skill, would it be better to use Task.delay() or Animation.TimePosition for precise timing?

Additionally, I’ve noticed a sound effect delay when joining my game. For instance, when I use a skill immediately after joining, the sound effect is delayed by approximately 0.5 seconds. This delay affects skills, dances, and primary attacks (M1s). I’ve attempted to pre-load everything, but I’ve been informed that there’s a cap on pre-loading animations and SFX. Is there an effective solution to this issue? I’ve considered implementing a pre-loading system, but I’m unsure if it would successfully pre-load all necessary assets.

local ContentProvider = game:GetService('ContentProvider')

local list = {
	workspace,
	game:GetService("ReplicatedStorage"),
	game:GetService("StarterGui"),
}

for _, Service in list do
	local NewList = {}
	
	NewList = Service:GetDescendants()
	
	ContentProvider:PreloadAsync(NewList)
end

print("Done preloading!")

In my opinion, AnimationEvents are the best way to sync sounds.
Although tedious to add, it’s worth it.

For more information about AnimationEvents, go check out Animation Events | Documentation - Roblox Creator Hub.

1 Like

Yeah like the other guy said, animation events (while also playing the animation on the server and using remote events to send the client information) are the most accurate for sync.

Don’t animations already replicate to all clients when played on the client side? If we play the animation on the server, wouldn’t it cause them to replicate twice?

yes but you can’t use animation events if they are being played by someone else