Time for action – Debugging using the log
The first question we need to ask is: are our classes being used in the first place? Let's put a few logs in to find out.
We'll start with
BrokenActor
. Even though we see it in the map when we run the game, we shouldn't make any assumptions about what's going on. We'll add a log inPostBeginPlay
:simulated function PostBeginPlay() { `log("BrokenActor PostBeginPlay!"); foreach DynamicActors(class'Pawn', Master) break; }
We'll also add one in
BrokenGame
:function PostBeginPlay() { `log("BrokenGame PostBeginPlay!"); }
And finally one in
BrokenPlayerController
:simulated function PostBeginPlay() { `log("BrokenPlayerController PostBeginPlay!"); }
Compile the code and run the game.
Exit and take a look at the log. We'll see that all three actors are logging their
PostBeginPlay
functions:[0005.44] ScriptLog: BrokenActor PostBeginPlay! [0005.44] ScriptLog: BrokenGame PostBeginPlay! [0005.44] Log: Bringing up level for play took: 0.032277...