14-05-2021, 03:34 PM
(14-05-2021, 12:08 PM)josemendez Wrote: Got it. The rope actor is being included in the solver, so the solver constraint network needs to be rebuilt. Since this is a time consuming process, the solver uses a "dirty" flag to signal that constraints should be rebuilt at the start of the next frame. This allows to add many actors at once without having to rebuild everything immediately after adding each one.Perfect.
So what's happening is that your scripts' Start() function is called right away and disables the solver. This prevents the constraints from being rebuilt. The attachment finds that the actors are loaded in the solver, so it tries to access the constraints (that haven't been built yet, since the solver is disabled). This is what causes the out of bounds.
There's several ways to work around this, the simplest one is waiting for one frame before disabling the solver:
Code:IEnumerator Start()
{
yield return 0;
solver.enabled = false;
}
That should fix it
Have a nice day
