Accessing blueprint classes


I’m working on an assignment for university which is to program the Pac-Man ghosts AI. They have given us a template for the Pac-Man game which is function able but the ghosts don’t move as we have to implement that ourselves. They have setup this template in Blueprints but I’m using C++ to program the AI.

What I’m asking is how would I access variables from their blueprint classes in my C++ classes I’ve had a look around and couldn’t find anything that works. I’m trying to access the ThirdPersonCharacter blueprint so I can get the players location at all times as that’s what the ghosts algorithm needs.


Hi! If you need to get something in C++, it must be declared in C++. That is, we do this: everything that is needed in C++ is declared in the basic C++ class. And then the blueprint is inherited from it.

The transforms are already declared in C++ in the Actor class. You can use GetActorLocation etc.