I see the AActor * GetOwner() const syntax in the documentation. I am unclear on how to implement this. And on a understanding level. I thought that the point of casting was that that step is what found and linked the character in the world to the variable.
#include "Wed3182Character.h"
class AActor* OtherActor;
AWed3182Character* MainCharacter = Cast<AWed3182Character>(OtherActor);
is the method of creating the reference that allows GameInfo to know about MainCharacter. MainCharacter being a stand in for AWed3182Character. What more is needed? I do not know what other details to tell you.
I feel that I have a pretty good understanding of functions and references, I have done considerable research on this particular issue, and I considered going to a forum to get help one of the last resort steps to take, as oft answers are useless, insulting, or what ever. By the way your recommended solution did not work. Seemingly, your solution is to use the needed reference to obtain the needed reference.
Hi, what casting does is checking whether a reference to something is of the type you’re casting it to. If you just do class AActor* OtherActor;
then this will not point to anything valid, so casting it to anything will again output something invalid. In other words if you have OtherActor and want to cast it to AWed3182Character, then this will only succeed if OtherActor is a reference to an AWed3182Character. So casting won’t give you a reference to an AWed3182Character, it just checks whether a given reference points to an AWed3182Character.
One way you could get a reference to an existing AWed3182Character would be via UGameplayStatics::GetActorOfClass.