What I want to do is I want a door to open after someone enters a password into a widget I set up with blueprint. I created a C++ class to open the door which works and I am now trying to set up a if statement for it to open when a variable I created changes.
Now I am trying to introduce my variable into other .cpp files specifically the one that opens my door but the problem is its not Identifying. My suspicions are that I am missing #include.
And here is the variable working in blueprint am trying to have it so when this is set c++ class for my door will take note of it and open the door according to my if statement.
OK I fixed the issue with UGamePlaystatics by changing the capital P to a small p to get UGameplayStatics.
However the issue with cast is still present and Get World now has the following error:
Uworld *UActorComponent::GetWorld() const
argument of type “UWorld *” is incompatible with parameter type “const UObject”
Apologize for that, the example listed in my comment is incorrect. Initially I thought I wrote it incorrectly but it appears the forums here doesn’t like a full cast < > example. Put your ACemeteryFPSGameModeBase between those symbols in the example below.
Use Cast<>(UGameplayStatistics::GetGameMode(GetWorld()));