Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to rest all state
#1
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;
Reply


Messages In This Thread
How to rest all state - by _gaoyu_ - 02-02-2019, 02:33 PM
RE: How to rest all state - by josemendez - 03-02-2019, 02:13 PM
RE: How to rest all state - by _gaoyu_ - 04-02-2019, 09:52 AM
RE: How to rest all state - by josemendez - 04-02-2019, 04:08 PM
RE: How to rest all state - by _gaoyu_ - 05-02-2019, 06:13 AM
RE: How to rest all state - by josemendez - 05-02-2019, 08:57 AM
RE: How to rest all state - by _gaoyu_ - 05-02-2019, 10:18 AM
RE: How to rest all state - by josemendez - 05-02-2019, 10:35 AM
RE: How to rest all state - by _gaoyu_ - 05-02-2019, 10:46 AM