Relationship between C++ classes and Blueprints

I’ve been humming along the course rather well until:
209 - Creating an AI Controller Class
and by the end of:
210 - Get the Player Controller with C++
I’ve become confused with the relationship between C++ Classes and blueprints.

I think perhaps because the instructor is creating blueprints and C++ classes with the same name/intent?

I was hoping to coast along working, but I’ve come across a bug where my UI widget isn’t visible, and doesn’t appear to be instantiating. To resolve that though i need to understand the program flow, and in the process of stepping through that flow (and putting debug messages into classes & blueprints) I’ve noticed I’m unclear upon how blueprints become ‘active’ (ie will have events trigger) or are instantiated by classes or whatnot. (with the exception of being specified in the GameMode blueprint or Maps&Modes, as they are the triggers for those blueprints)

I don’t see the point in selecting a parent class for a blueprint if that blueprint isn’t instantiated.
… I have a TankPlayerController Blueprint as well as a class… why?
There is a slide that i cant find where he indicates that we will have a blueprint and a class for some aspect of this game…

I have a tank blueprint that lets me drag the object onto the scene but an unknown something is instantiating those when i start the game.

Ugh - sorry I’m having issues googling this issue.


I think the most succinct solution to my problem would to be able to help me understand what the instructor is saying here:

209 - Creating an AI Controller Class
From 4:14 -> 5:52

If someone could help me understand or point me to a web resource that covers what he’s talking about it’d be much appreciated.

I ‘think’ that if i set a UPROPRTY for a variable, i might be able to access it via a blueprint somehow which is cool, but i don’t think that’s been covered yet… Maybe blueprints aren’t classes but are a fancy front-end to them?

A thing to keep in mind is that ALL blueprints are children of some parent C++ class at some point, and ANY Blueprint is a class. Actor is a child of AActor, Widget is UWidget, AI Controller is AAIController, etc.

In that portion of lesson 209, Ben is talking about how all Pawns are controlled by a class referred to as a Controller. Which for AI, needs to be set inside of the pawn whether it’s a blueprint class or a c++ class.

I’ll summarize a bit. You should treat Blueprints as classes even if they have a GUI for editing them, and pawns need to have an AI Controller class selected for them to be controlled by a non-player.

The best way to think about Blueprints is to treat it like a different programming language but with the same or similar concepts as c++.

1 Like

Thanks a heap for that! I’m going to sit down tonight with unreal infront of me and process what you’ve mentioned.

Righto it might take me a bit to figure it out completely but you’ve pointed me in a direction I can follow. I’ve corrected my bug with your help thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms