Gameplay improvement

This commit is contained in:
2020-01-19 18:43:37 +01:00
parent f866882f24
commit 0d80cee4aa
20 changed files with 953 additions and 54 deletions

View File

@@ -71,13 +71,13 @@ public class AIController : MonoBehaviour
inputs[AiInputs.VERTICAL] = 1;
}
Debug.DrawRay(transform.position, transform.TransformDirection(-Vector3.forward) * 8, Color.magenta, 0, false);
inputs[AiInputs.HORIZONTAL] = Mathf.Floor(this.angleToDestination * 10) / 10;
if (this.distanceToTarget < this.turnRadius)
{
inputs[AiInputs.HORIZONTAL] = Mathf.Floor(-this.angleToBall * 10) / 10;
Debug.DrawRay(transform.position, transform.TransformDirection(-Vector3.forward) * 10, Color.magenta, 0,false);
if (Physics.Raycast(transform.position, transform.TransformDirection(-Vector3.forward), 10))
if (Physics.Raycast(transform.position, transform.TransformDirection(-Vector3.forward), 8))
{
inputs[AiInputs.BOOST] = 1;
}
@@ -85,6 +85,7 @@ public class AIController : MonoBehaviour
}
if (this.distanceToBall < this.turnRadius)
{
RaycastHit hit;