Cast APlayerController

Hi, a little question…

why is necesary make a cast with APlayerController and why not declare the AController from start and use it in Tank.cpp

All the best
Marco.

That’s already stored and what is returned by GetController. However you wouldn’t be able to access members on APlayerController which is going to be needed later.

Demonstrative example: Compiler Explorer

Focus on what is written in main first.

2 Likes

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

Privacy & Terms