Obi Official Forum

Full Version: ObiSolver goes missing on an ObiActor prefab
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have several objects which share the same ObiSolver.
They are all prefabs.
I drag them onto the scene and set their ObiSolver to the one I have on the scene.
On runtime, their ObiSolver becomes None.
Is there a way to set them on runtime?
(11-04-2019, 12:45 PM)hecali_aj Wrote: [ -> ]Hello,

I have several objects which share the same ObiSolver.
They are all prefabs.
I drag them onto the scene and set their ObiSolver to the one I have on the scene.
On runtime, their ObiSolver becomes None.
Is there a way to set them on runtime?

Hi,

Prefabs in Unity cannot hold references to anything in a scene. This is because the prefab exists independently of the scene. This is just how prefabs work, not Obi's fault.

Simply set the solver at runtime:
Code:
actor.Solver = yourSolver;
actor.AddToSolver(null);