I am currently developing my first classes in Unreal Engine 4. Coming from using UScript extensively, I'm getting a little bit confused by how typecasting works in pure C++. More specifically, class/object casting.
I am currently putting together a switch statement in MyCustomGameMode which calls upon MyCustomPlayerController for MyCustomPlayerControllerVariable.
The function in question that I am overriding is this one: virtual UClass* GetDefaultPawnClassForController(AController* InController);
Currently I'm trying to call the variable with the following line of code, which I know is incorrect, but I'm not sure why:
Cast<MyCustomPlayerController>(InController).MyCustomPlayerControllerVariable
I am interested in casting the "InController" to MyCustomPlayerController but Cast<MyCustomPlayerController>(InController)
doesn't seem to work, what am I doing wrong here?