It seems very hard to get configured solvers to instantiate in a certain orientation like always in front of the SolverTarget. It seems you have to set the transforms values manually, the goal values of the SolverHandler and additionally call SnapTo on the Solver you're using because otherwise you have some kind of interpolation going on. I'm trying this with a RadialView and it already takes me too long to get this right, rotation and all...
What's the correct way to do this the right way? Set position, rotation, done?
If the object with the RadialView was created at edit time and is active, it will snap its orientation as you've described.
Unfortunately, instantiating an object, or re-enabling an existing object with a solver will cause it to "solve" against its original position. I've found the easiest way to force the correct position is to set the lerp time to "0" for a single frame.
[SerializeField]
private GameObject objectWithSolver = null;
private IEnumerator InitialSolve(Solver solver)
{
float originalMoveLerp = solver.MoveLerpTime;
float originalRotateLerp = solver.RotateLerpTime;
solver.MoveLerpTime = 0.0f;
solver.RotateLerpTime = 0.0f;
yield return null;
solver.MoveLerpTime = originalMoveLerp;
solver.RotateLerpTime = originalRotateLerp;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.J))
{
GameObject newObject = Instantiate(objectWithSolver);
newObject.SetActive(true);
StartCoroutine(InitialSolve(newObject.GetComponent<Solver>()));
}
}
That said, this sounds like a great feature request.