title: Referencing pawn player in c++ ue4
body: <p>for a project i am designing a tank game and want a tank to be constantly looking at my player but after looking online a lot i haven't found a solution to referencing my player in c++</p>
  
  <pre><code> ATank* myCharacter = Cast&lt;ATank&gt;(this);
  
       if (myCharacter)
       {
           FVector targetLocation = myCharacter-&gt;GetActorLocation();
           FVector myLocation = GetActorLocation();
  
           FRotator newrot = (myLocation -targetLocation).Rotation();
  
           NewRotation.Yaw = newrot.Yaw;
           SetActorRotation(NewRotation);
       }
  </code></pre>
  
  <p>above is what i have at the moment which does nothing as its not finding the player and before i put the if statement in it was just crashing, any help/guidance is appreciated and thanks in advance.</p>