Another solution that worked for me was adding a simple wait(2) at the start of the server script. Also from what I noticed, it only happens to the NPCs that were cloned before the player fully loaded in.
Tested, same problem. Try one of Roblox Realistic animations package IDs: rbxassetid://507766388
It always results in bug.
I tried the wait(2) thing, it doesn’t help me. And this issue persists even after player has fully loaded. In my animation bug testing place I’ve set the :Clone() to happen after 5 seconds, pretty much enough time for player to load, even if I were to set it to 2 minutes this bug would still occur.
This works perfectly fine for me
Probably last one thing I will try is using Server Script for every :Cloned() NPC that needs Idle animation.
Have you tried running studio Play test like 15 times in a row?
Yes I have tried, maybe 12-13 times?
Just to rule this out, can you try disabling retargeting on your Workspace instance and see if that makes a difference?
Alright give me few minutes. Besides I found a temporary “solution” by switching that Idle animation with Roblox Toy Animation package Idle ID. I tried making my own animation which would look similar to the bugged one today, but it broke as well. I’ll go try the retargeting thing right now.
WOOOOOWW! OMG this fixed it! Thank you so much!!! I’ve been battling this issue solo for about 5 days now before posting it here. I’ll disable retargeting on all of my game places now!
OK, I’m going to look into why this was happening for you. Is the test place you posted everything we need to reproduce the issue?
Pretty much yes, this happens after every 5-10 Test Play tries in studio, it glitches every time in different ways. Also I noticed once that changing ModelStreamingBehavior thing under cloned Model class to something like “Default” will result in even worse bugs, but I haven’t tested myself ModelStreamingBehavior much yet.
This bug was most noticeable in my game place which is public, the spawned idle standing NPCs for missions would end up glitched.
I forgot to include that the asset ID in the test place is not public. It’s an animation asset that uses same animation as rbxassetid://507766388 the IdleStand animationID can be just replaced to that.
Here’s a test place version with rbxassetid://507766388
BuggedAnims2.rbxl (138.6 KB)
Thank you! That test place was very helpful. I did a quick modification to spam down a 100 clones and it made it easy to spot the issue.
The problem is related to streaming and how we cache our retargeting info. If animation is played before all the character’s parts have replicated then the retargeting gets calculated in a bad state. That’s something we’ll need to look into on our end. This seems to be an issue with non-player characters.
However, there are a couple alternative work arounds that should also work. I tested these locally:
-
Wait for the necessary parts to load before playing animation. Like:
instance:WaitForChild("RightHand")...
.
This might be a bit ugly, especially if you don’t have consistent naming. -
Change the ModelStreamingMode to “Atomic” on the rig you are cloning (or disable streaming for the workspace), this makes all the parts come down together.
Hey, thank you for helping me.
I’ve set all my in game NPCs now including enemy NPCs to Atomic ModelStreamingMode. I’ve tested game with Retargeting disabled and afterwards with Retargeting enabled. It works perfectly well, smoothly running animations and no other issues or errors.
This is unrelated to this issue, but I had other issues with Content Streaming such as StreamingRadius settings, which would end up crashing mobile devices if the Radius number is set too high, and having a lower Radius on high end PC resulted in poor visual performance. I’ve mitigated such issue by using :RequestStreamAroundAsync() for players with high end PCs and consoles to preload the entire map, while keeping StreamingRadius number relatively low to not impact mobile players performance negatively.
I think it would be good if it was possible to have separate min-max StreamingRadius numbers for mobile devices and PCs, as current Streaming behavior causes objects to be quickly streamed out, then soon after streamed in again to achieve StreamingTargetRadius, which ends up causing lag for device and requiring objects to be streamed out again. I had to set both Streaming Min and Target Radius numbers to same values in order to prevent streaming buffer feature from working.
This streaming issue is though more related to games with huge and complex maps, so it doesn’t affect most games.
Thank you again for all the help, this really saved me as I was already panicking not knowing what to do about animations.
Happy to help! This also helped us shake out a few more bugs with the retargeting system, so win/win!
I’d say go ahead and make a new post about the platform specific streaming settings. It sounds like a fine idea to me but that’s outside my domain.
Cheers!