New answers tagged ai
The method you are looking for is Quaternion.LookRotation. First you need to calculate the relative vector between player and tank. You do that by simply subtracting the position of the tank from the position of the player. Then you use Quaternion.LookRotatation to create a rotation into that direction. Vector3 playerDirection = player.transform.position - ...
This is the while loop above redone. Kind of ugly and repetitive but it works. I had to use Math.floor and Math.ceil to solve the collision issues which is due to precision I guess. Any spare dt left over if the action sequence is finished is discarded so that might be something to save for accuracy but the timesteps are really small so it may not be ...
Use expectimax (Russell and norvig Artificial intelligence 3rd edition). Alpha beta is possible with bounded evaluation function values)
Top 50 recent answers are included