BaseParts(?) vanish from NPCs during combat (30+ mobs active) – No manual deletion, not Studio reproducible

So I’ve been toying around in my game for a while, testing out mob performance and whatnot.
Recently I found out that mobs will randomly have their children removed while they’re actively fighting and there happens to be more than 30-40 mobs spawned.

I might as well mention that in none of the behavior scripts do I ever destroy any instances (Closest thing I do is removing the model).

This also seems to happen independently if they’re ragdolled or not. So I doubt it’s because of any physics bugs that cause the model to go to nan.

Disabling streaming helped for a bit but the behavior is the same when I reach 50+ npcs.

IN SHORT:

  • Baseparts inside mobs disappear for some odd reason (Scripts, folders and other instances seem to be intact)
  • This doesn’t happen inside studio, ever.
  • This only seems to happen when they’re fighting.
  • This only seems to happen when 30-40 mobs are fighting.
  • Streaming possibly having a part on this? (Haven’t properly tested it.)

Can anyone help me figure out what’s going on? I’ve already made it so npcs unload and have their behavior disabled when no players are nearby (Given how 40+ npcs fighting at once is an unrealistic scenario) but I still want to figure out what is causing this.

1 Like

i would check any and all possible destroy calls, track ancestrychanged to see where the npcs go

the npcs dont look like they fling or fall into void just… culled instantly, if you open a new studio file and have 100 or more npcs moving around the given behavior doesnt happen

also something but i dont think it affects anything like we’re seeing, doesnt highlighting work improperly when you have more than 30 highlights even if they are not on?

it can also be beneficial to see metrics in dev console; is game under extreme loads? physics?

Something similar to your problem has happened to me before when calling :MoveTo()/:Move() with vectors whose axis are nan. Whenever you calculate the .Unit of a vector with 0 Magnitude or 0,0,0, it returns nan which stands for not a number because it is dividing by 0 (The magnitude) and it messes with a lot of things if you use them in part velocities/positions and destroys BaseParts whenever nan is set as velocity, position or even move directions in humanoid objects. Tho I’m not sure if this is exactly the source of your problem since you said it’s InGame specific and that it only happens when a certain amount of mobs exist, but I’d recommend you to check it out.

1 Like

I found a post that is similar in nature to my problem and after disabling the AlignOrientation the baseparts seem to remain intact.
Seems like it was a nan issue after all.


(Video is compressed)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.