Beispiel #1
0
 protected void FixedUpdate()
 {
     if (targetInView)
     {
         if (gameController.waitingForPass)
         {
             gameController.StartCountdown();
         }
         else
         {
             Vector3 targetDir = transform.position - target.position;
             //float angle = Vector3.SignedAngle(targetDir, target.forward, Vector3.forward);
             //float angle = transform.rotation.y + 90.0f;
             text.text = transform.eulerAngles.ToString();           //targetDir.x.ToString();
             playerController.Move(targetDir.x / 25);                //(transform.rotation.y + 90) / 15);
         }
     }
     else
     {
         playerController.Move(0.0f);
         text.text = "Not in view";
     }
 }