RVOCoreSimulatorBurst.cs:451, in 4.3.46 beta, throwing object reference not set to an instance of an object error

This is very very strange.

I recently started limiting debris in my game. Nothing unusual: if I accumulate more than X game objects with a debris script on it, it destroys the oldest. No different than destroying other game objects, right?

Well, for whatever reason, this throws RVOCoreSimulatorBurst line 451 into a world of pain:

public void SetTarget (Vector3 targetPoint, float desiredSpeed, float maxSpeed) {
				simulator.simulationData.SetTarget(agentIndex, targetPoint, desiredSpeed, maxSpeed); //this is line 451
			}

Either the simulator or simulation data is null. Hard to tell which, since the Unity package manager overwrites changes I make.

I have also seen other places panic, like suddenly newly characters with RVOControllers will say there is no RVOSimulator anymore, despite one plainly existing, and having existed the entire game. RVOSimulator.active seems to return null.

The debris is mostly mundane, like bullet holes, but some are ragdolls, which were once AI characters, but they had their RichAI, RVOController, and Seeker destroyed long before the debris script destroys them. Not surprisingly, the errors are seemingly not occurring on anything that once had any AI attached to it.

EDIT: I am a dummy, who accidently put a RVOSimulator on a character, instead of a RVOController. That’s what I for being hasty, haha.

Thanks!

1 Like