Challenge - Optimize the Project Scripts
Tutorial
·
intermediate
·
+0XP
·
10 mins
·
(48)
Unity Technologies

In this tutorial, you will use the Profiler window to determine where you can improve a scripts performance.
1. Identifying the Problem
1. Use the Profiler to identify a problematic performance
a. Open the Profiler in Unity, by going to Window > Analysis > Profiler.
b. Play the game and observe the performance profile using Deep Profile if necessary
c. Identify the AI Behavior as a hindrance to performance

d. Record the profile data to use as a baseline (never optimize without a baseline)
2. Optimizing the Script
1. Optimize the AI Behavior
a. Open the SimpleAI script
b. Determine the problematic section of the code

c. Fix the code section by commenting out the culprit

3. Analyzing the Result
1. Use the Profiler to analyze the results
a. Open the Profiler in Unity
b. Play the game and observe the performance profile
c. Compare to your benchmark
