I was wondering: what is an elegant way (Epic-recommended) to be able to have a two-way communication/access between a custom PlayerController and custom Character. What I mean is, say I have derived from the standard classes that come with the engine and I have MyGamePlayerController, and MyGameCharacter c++ classes. Whenever I use the standard given “GetController()” or “GetCharacter” (or GetPawn or GetControlled Pawn or whatever), I always have to worry about casting.
What shall I do? Is it an ok practice to keep casting whenever I need this two classes to refer to each other? Is it better to create references to each other in the definition of each class, by taking care of casting only once in each case, so that I don’t have to worry about it?
Thanks man. I was starting to lean towards that solution myself. I was about to do this via begin play, but I like your approach with the Possess method too… Even if I only cast a few times, my code right now is fluid and not final so in the future it can improve speed and workflow if I have just one reference in each class to use freely.