If (ToonTanksPlayerController) is not working

I’m confused, why would if (ToonTanksPlayerController) not be valid?

I added some extra code for troubleshooting:


It appears I’m hitting the Else section of this if statement. So why is that?

I did have the Player Controller Class set to ToonTanksPlayerController so I fixed that to the right one, BP_ToonTanksPlayerController but it’s still not working.
image

I also can tell it’s not working because I can’t see the Crosshairs either. What did I do wrong?

Do you have a game mode override in the world settings?

I see the problem. I called UGameplayStatics::GetPlayerPawn instead of UGameplayStatics::GetPlayerController for my ToonTanksPlayerController variable. Now it’s working properly.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms