Brick
Brick

Reputation: 11

Using a simulated event BecomeViewTarget to make an isometric camera

I'm following a tutorial on making a top down/isometric camera and have run into a bit of a snag. See, the following comes up when I compile.

BGCGamePawn.uc(15) : Error, Type mismatch in '='

Now, I've managed to get this far so I understand that the problem lies in the following bit of code. Line 15 is bold.

//override to make player mesh visible by default
simulated event BecomeViewTarget( PlayerController PC )
{
   local UTPlayerController UTPC;

   Super.BecomeViewTarget(PC);

   if (LocalPlayer(PC.Player) != None)
   {
      **UTPC = BGCGamePlayerController (PC);**
      if (UTPC != None)
      {
      //set player ctrl to behind view and make mesh visible
         UTPC.SetBehindView(true);
         SetMeshVisibility(True); 
         UTPC.bNoCrosshair = true;
      }
   }
}

Upvotes: 1

Views: 666

Answers (1)

Phillip
Phillip

Reputation: 609

Does BGCGamePlayerController extend from UTPlayerController? If not, that would be the problem: you're trying to cast your PlayerController parameter into a BGCGamePlayerController but then store it in a local UTPlayerController variable. You'll need to change the type for your local variable or change the hierarchy for your BGCGamePlayerController.

Upvotes: 1

Related Questions