When using RVO, at first load it runs fine, but when reloading the scene, it fails to get the RVOSimulator, debugging this in Awake : “No RVOSimulator component found in the scene. Please add one.”
Fixed it by replacing :
cachedSimulator = cachedSimulator ?? FindObjectOfType(typeof(RVOSimulator)) as RVOSimulator;
by
if((cachedSimulator == null))
cachedSimulator = FindObjectOfType(typeof(RVOSimulator)) as RVOSimulator;
I was surprised to see the “??” operator in your code as I was sure it was not working on Unity, turns out it sort of works then?
Debugging showed up that even though cachedSimulator was null, and the findobject wasn’t, it’d still pick the cachedSimulator.