Class Blueprint not Firing

So I’m really new to Unreal Engine. I have made a class blueprint, but it doesn’t fire at all. The same blueprint works if copy the code into a “level blueprint”

Do I need to place an object (a mesh thing from the viewport editor) of a class blueprint inside a level for it to work? If not, why isn’t my class blueprint firing?

Not sure how to word things better sorry. Kind of new to all of this. Hope you can understand.

yes. the Blueprint class is as the name suggests a blueprint. You have to instantiate it first. For Actor-based Blueprints, you need to place them in the world.

Here’s my blueprint - ignore the isolated “guns” variable, lol
![

I’ve placed a “pawn” inside my level as you can see (the little white sphere)

![

When I play the game and press the F key, nothing happens. This works fine if I copy the code into a “level blueprint” Maybe I just need a quick explanation of how to setup a class blueprint? What am I missing? I’ve read its good practice to use class blueprints because they’re easier to copy into different levels and projects, so I’d like to get it working.

The engine wants the default player controller to have a Pawn, so by default it will spawn one for you (unlike most other things which you have to place in the level or spawn yourself).

Delete your pawn from the world and go to “Project Settings > Maps & Modes > Default Modes > Selected GameMode > Default Pawn Class” and set it to your pawn class.

Then when you start the level, your pawn class will be spawned by your player controller.

Thanks for the replies, but I still can’t get it to work. Here’s an image where I’ve set my pawn like you instructed. My blueprint still isn’t doing anything.

I’ve already followed this tutorial: v=_NCtcHXJPjg&index=31&list=PLZlv_N0_O1gaCL2XjKluO7N2Pmmw9pvhE
on making some lights out of class blueprints, but now I can’t get my simple loop code to run. Not sure what I’m missing.

Really appreciate your patience guys :slight_smile:

Hmmm… A good tutorial like Zak does should just work. I recommend starting over and following him carefully. You probably just missed a step somewhere.

Hey guys, I’ve managed to get it to work. I had to go into the defaults tab and select Player 0 from the “Auto Select Input” box. It probably didn’t know how to receive the “F” key I was hitting. Thanks for your help. Does this forum have a “reputation” system or a credit thing that I can give you guys?

If there is, I haven’t encountered it yet.

If you post your questions over in AnswerHub instead, then that system does have a reputation system and you can definitely bump people there. That’s how I got my “AnswerHub Sage” badge.