How to prevent lag with AI Rig

I have a intensepart ai rig that is the antagonist for my game, however when the player defends themselves from the ai and it ragdolls itself, it generates a lot of lag and sometimes would even crash the server or kick the player that’s near the rig.

Can anyone help me with this? I’ve tried enabling and disabling properties in the parts of the rig, but it shows no change.

So you used an ai plugin to make it?

No i didn’t. the rig was homemade from scratch. I’m curious how to prevent lag from occuring when the AI ragdolls itself when it gets attacked by a player.

Well… does the zombie just chase players, or does it have to do more?

It has pathfinding and such, however when it gets ragdolled, the scripts are disabled and the only thing happening is just the ai ragdolling, which is supposed to happen. I’m trying to figure out How to prevent lag when the ai is in it’s ragdolled state.

Because you can use Roblox’s “drooling zombie”, change the character to your character, and it will chase you and try to kill you…without lag, I think

The ai is fine and does not need any tweaking. The lag with the ragdoll is simply what i’m trying to solve.

Hm… so when you kill it, all of a sudden it becomes laggy

But it is not laggy when it is not dying

When it gets damaged, it ragdolls. When it gets ragdolled, it gets laggy. It doesn’t ragdoll when it dies, and that is not part of the issue.

By rag doll, you mean it goes limp?

You are correct, and when it goes limp, that is when the lag comes in. When the ai “gets up”, the ragdoll state is reverted and the lag is gone.

hey, there’s most likely alot of physics interactions in that, if you have blender and know your way around it a little, you should export limb sections into blender and then re-import them, it should decrease part count and therefor result in less lag

3 Likes

Maybe the physics of the thing falling gives you lag if your computer has a weak processor… does your computer lag when you have falling objects?

Well, I don’t know. That is a cool looking monster, though!

Just tried to do that, and blender stops responding, only to close itself.

Does LevelOfDetail have any impact with this?

1 Like

Does your computer usually crash a lot when making other games involving small amounts of physics? Because if blender is now crashing, maybe you should upgrade your computer if it is just a slowness/crashing issue.

Yes it does. Also what is your pc specs. So we can know what is the issue.

For me, my game is always laggy when playing it in studio, but when I publish it, it does not lag in regular Roblox. So try publishing it (you can make it Private so only you can play it since it is not done), and try playing it in Roblox, not Studio, and see if it still lags.

I have AMD CPU and GPU, the ragdoll lag isn’t just me, when people attacked the AI in my game, they also lagged. Some with godly computers also lagged aswell.

image
image