20-08-2018, 10:10 AM
hi, i been trying to make a grapple hook similar to the included one in the package,when i shoot the hook game object and it sticks to other objects i need the robe to be much less stretchy.im using a simple script to control the prematers of distance constraints ,it works fine and it changes the parameters correctly .the problem is , it only changes the numbers .the real changes only going to be applied when i insert the numbers to obi solver manually.
how do i change the distance parameters like iteration and relaxation by script and see it actually happen in the play mode?
and here is the code:
public void less stretch()
{
obiRopi.GetComponent<ObiSolver>().distanceConstraintParameters.iterations = 38;
obiRopi.GetComponent<ObiSolver>().distanceConstraintParameters.SORFactor = 1.5f;
}
how do i change the distance parameters like iteration and relaxation by script and see it actually happen in the play mode?
and here is the code:
public void less stretch()
{
obiRopi.GetComponent<ObiSolver>().distanceConstraintParameters.iterations = 38;
obiRopi.GetComponent<ObiSolver>().distanceConstraintParameters.SORFactor = 1.5f;
}