Time for action – Expanding the Controller
Right now we have a pretty simple setup for our camera. It stays at a fixed position over our player and never moves from that relative position. Let's change it so that it's focusing on a point a bit ahead of our player, that way it will let them see more of what's in front of them while leaving their backs exposed to a surprise attack.
Let's take a look at our
GetPlayerViewPoint
function:simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation) { super.GetPlayerViewPoint(out_Location, out_Rotation); if(Pawn != none) { Pawn.Mesh.SetOwnerNoSee(false); if(Pawn.Weapon != none) Pawn.Weapon.SetHidden(true); out_Location = Pawn.Location + PlayerViewOffset; out_Rotation = rotator(Pawn.Location - out_Location); } }
Well some of this looks more familiar now that we have our own Pawn class. We can move the first two parts of our if statement out of this function, so let...