Game Development Reference
PotentialCameraLocation is where we actually want the camera to be.
The HitLocation and HitNormal variables are used for our trace.
This comes into play when our camera bumps into a wall, and rather than
clipping through the wall, allows the camera to be offset, so that it still
displays our pawn without interrupting the gameplay experience.
Finally, the HitActor variable declares what we've just hit when doing
If we know which pawn socket name we'd like to use, then declare it, otherwise
we'll use the pawn's eyes as our default starting point for what we see (that is,
we draw our viewpoint from where the weapon is pointing instead, using the
/** Our pawn will be where we are grabbing our
perspective from */
Pawn = Pawn(OutVT.Target);
/** If our pawn is alive*/
if (Pawn != None)
/** Start the camera location from a valid socket name,
if set correctly in the camera properties */
// (i.e. WeaponSocket)
/** Otherwise grab it from the target eye view point */
The weapon socket is one of the properties we'll declare in the
TutorialCameraProperties class, so we won't have to
worry about hardcoding it here just yet.