14-02-2019, 04:46 PM
(14-02-2019, 04:18 PM)josemendez Wrote: Hi there,Hello.
The code in most snippets assumes the solver/actor are already declared. Unless the sample code is an entire script, it is assumed these variables come from your own code.
There's many ways to get a reference to a solver. If you already have an actor, you can obtain the solver that manages it:
Code:ObiSolver solver = actor.Solver;
You can also declare a public variable in your script, and fill the reference from Unity's inspector:
Code:public class YourScript : MonoBehaviour
{
public ObiSolver solver;
//.... rest of your code...
}
That's just two possibilities. Being a variable, you can declare a variable of type ObiSolver anywhere in your code and fill it from anywhere you want. As long as you respect C#'s syntax, that is.
I really appreciate your hints. I think I could make one. Is it perfect?