Exemple #1
0
 // Update is called once per frame
 void FixedUpdate()
 {
     //hacked cleanup to prevent from falling thru world
     if (transform.position.y < -5 || transform.position.y > 20)
     {
         GetComponent <Rigidbody>().velocity.Scale(Vector3.zero);
         transform.position = GameObject.FindGameObjectWithTag("Respawn").transform.position;
         gameObject.SetActive(false);
         manager.recycleBullet(this);
     }
     if (gameObject.GetComponent <Rigidbody>().velocity.magnitude > 0)
     {
         //	Debug.Log(gameObject.GetComponent<Rigidbody>().velocity.magnitude);
     }
 }