Ben put the declaration of PayerViewPointLocation
and PlayerViewPointRotation
in TickComponent
function, And that means the engine will keep declaring them evey frame. shouldn’t they be in the Header file under private:?
Not really. The function itself is going to need a place to store an intermediate variable which has both Location and Rotation which then assigns those members to the respective variables.
const FMinimalViewInfo CurrentPOV = GetCameraCachePOV();
OutCamLoc = CurrentPOV.Location;
OutCamRot = CurrentPOV.Rotation;
Which the variables which we created would just be using.