Time for action – RUN AWAY!
The first thing we need to do is figure out if the enemies are running away at all. Is what we're seeing happening on both the server AND the client?
Let's change the
RunAway
function ofAwesomeEnemy_Minion
:simulated function RunAway() { `log("Run away!"); GoToState('Fleeing'); }
This will let us know if this function is getting called.
Let's also change the
AwesomeEnemy
class'sFleeing
state:simulated function BeginState(Name PreviousStateName) { `log("Begin fleeing state!"); MyMesh.SetMaterial(0, FleeingMat); }
We should have our bases covered for debugging this, so let's see what happens. Compile the code and run it. Looks like we're getting the logs, but only on the server:
[0050.61] ScriptLog: Run away! [0050.61] ScriptLog: Begin fleeing state!
So the client is never receiving the
RunAway
function call, even though we changed it to simulated. The reason for this is that theRunAway
function call is coming from the enemy spawner...