Time for action – No, my left!
As a top down game, our control scheme is pretty terrible. When we press any of the direction keys on the keyboard, it's pretty tough to tell where the player is going to go. Right now our movement is based on our Pawn's rotation, so if we're facing the bottom of the screen, pressing left will actually make the pawn move to our right. Let's fix that.
To do this we're going to need a Rotator variable. We can't just pull
out_Rotation
from theGetPlayerViewPoint
function, so we'll do the same thing we did with ourDesiredCameraRotation
and create a variable to store it.var rotator CurrentCameraRotation;
Now let's add a line to the end of our
GetPlayerViewPoint
function to store ourout_Rotation
:simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation) { super.GetPlayerViewPoint(out_Location, out_Rotation); if(Pawn != none) { out_Location = CurrentCameraLocation; out_Rotation = rotator((out_Location * vect...