Complete the code to make the AI move towards the player.
Vector3 direction = player.position - [1].position;The AI uses its own transform.position to calculate direction towards the player.
Complete the code to make the AI rotate smoothly towards the player.
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(direction), [1] * Time.deltaTime);The speed variable controls how fast the AI rotates towards the player.
Fix the error in the code that makes the AI chase the player only if within range.
if (Vector3.Distance(transform.position, player.position) [1] chaseRange) { ChasePlayer(); }
The AI should chase the player only if the distance is less than or equal to the chase range.
Fill both blanks to create a dictionary of enemy names and their health if health is above 0.
var aliveEnemies = new Dictionary<string, int> { { [1], [2] } };The dictionary key is the enemy name as a string, and the value is the health as an integer.
Fill all three blanks to filter enemies with health above 50 and create a dictionary with their names and health.
var strongEnemies = enemies.Where(e => e.Value [1] [2]).ToDictionary(e => e.Key, e => e.Value [3] 10);
The code filters enemies with health greater than 50 and adds 10 to their health in the new dictionary.