I disable ObiActor and rest partcle position . wait 0.5 second , I enabled ObiActior ,but I found previous Acceleration still exist. Why?
code:
GetComponent<ObiActor>().enabled = false;
GetComponent<SkinnedMeshRenderer>().enabled = false;
transform.position = new Vector3(Random.Range(-4.0f,4.0f),1.5f,Random.Range(-4.0f,4.0f));
GetComponent<ObiActor>().Solver.positions[pId] = transform.position;
GetComponent<ObiActor>().Solver.velocities[pId] = new Vector3(0.0f,0.0f,0.0f);
yield return new WaitForSeconds(0.5f);
GetComponent<ObiActor>().enabled = true;
GetComponent<SkinnedMeshRenderer>().enabled = true;
code:
GetComponent<ObiActor>().enabled = false;
GetComponent<SkinnedMeshRenderer>().enabled = false;
transform.position = new Vector3(Random.Range(-4.0f,4.0f),1.5f,Random.Range(-4.0f,4.0f));
GetComponent<ObiActor>().Solver.positions[pId] = transform.position;
GetComponent<ObiActor>().Solver.velocities[pId] = new Vector3(0.0f,0.0f,0.0f);
yield return new WaitForSeconds(0.5f);
GetComponent<ObiActor>().enabled = true;
GetComponent<SkinnedMeshRenderer>().enabled = true;