When testing in Roblox Studio, setting the WalkSpeed of 30 NPC characters to 20 and the WalkSpeed of the player to 20 results in the same movement speed, which seems normal. However, when I publish the game on the Roblox website and run the game, the NPC’s speed drops by almost half. I have tried various things for a week but can’t figure out what the problem is. I don’t understand why the NPC speed is different between running in Studio and publishing on the website. I would appreciate any hints or help to solve this issue.
It may be lag, I heard :MoveTo isn’t the best for performance and 30 NPC’s might be pushing it.
Thanks
Oh, I see. I didn’t know that. I just tested it again and even when I limit the moving NPC characters to about 10 and anchor the other 20 characters in place with the Anchored property set to true, the WalkSpeed still decreases. It’s not halved, but it seems to have decreased by about 30%. If the NPC’s movement speed also slows down in Roblox Studio, it would be easier to fix, but it’s hard to figure out when the issue only occurs in the published game.
Could I see the code for the NPC movement?
It’s difficult to pinpoint the specific part of the code related to NPC movement as it involves multiple modules and interactions. However, the pathfinding and movement modules have been used without issues in other games, so there may not be a problem there. My main concern is why NPC movement speed is normal in Roblox Studio but slower in the published game. One thing I suspected was the number of NPCs, as reducing the number to less than 10 resulted in normal movement speed in both Studio and the published game. However, when the number of NPCs exceeds 30 (I tested up to 100), movement speed is normal in Studio but significantly slower in the published game. If this is a known issue, I’ll try to modify the game accordingly
As far as I know (which is saying basically nothing) this isn’t a known issue. But I notice now that in some other games with lots of NPCs, the NPCs tend to lag behind, so it might be unavoidable.
Thank you for taking the time to provide helpful responses. I will continue to work on the issue and make changes as necessary, and will update you if a solution is found. Thank you again for your assistance.