Game Development Reference
In-Depth Information
Now, we know that the FPS is not stable and we need to fix it, but how can we know where
the problem came from, what is its actual cause? You will need to play through the game and
see when the FPS is going down.
First, let's think about the problem. If you look closely, you will observe that the FPS keeps
luctuaing. Hence, we can assume that this is not a graphics or memory problem, as that
would have caused the game to crash or the FPS to remain consistently low.
If you are using Unity Pro, you can also use the profiling
opion in Unity to ind the problemaic code, which will be
explained later in this secion.
Next, let's take a look at the issue that might have caused the problem. It might be our
player script or the AI script. As we haven't even controlled our character, it is likely that the
problem is in our AIController script. In order to verify this, let's move our character to a
posiion where we can see our AIs.
In the Statistics window, we see something wrong. The problem is that every ime the AIs
start moving, the FPS decreases. On the other hand, when the AIs stop moving, the FPS goes
back to normal:
 
Search WWH ::




Custom Search