How to reference an instance of a Blueprint from the Level Blueprint?

I want to get a reference of an instance of a Pawn Blueprint I placed on the level from the Level Blueprint. I’m following this official tutorial on how to set up Blueprint communications. I was able to do it just like the tutorial shows to reference the Blueprint I want from another Blueprint placed on a map. But if I want to reference it from the Level Blueprint. The tutorial says:

“If your working Blueprint is the Level Blueprint, you specify the Blueprint instance you want to use in the Blueprint Editor, not in the Level Editor. By default, the Details panel in the Blueprint Editor is in the lower-left corner.”

But on the Details panel of the Blueprint Editor, I get a message “Default Value: Editing this value is not allowed” when I select the Pawn reference variable.

I found other people posting similar problems but the solutions were always dodging the problem by using GetAllActorsOfClass. Which would force me to loop on all objects without necessity, which I would like to avoid.

How do I get reference from a specific Pawn placed on a level from the Level Blueprint?

‘how to access a BP instance from level BP’. This is pretty straight forward. Place an instance of the BP. Then drag this instance into the level BP from the scene outliner.

But if you are trying to set a default value for a member of a BP, things are different.

In-order to set the default value of an Object reference, you first need to make an instance of the blueprint.

Ie. Suppose you have a MyPawn BP and MyActor BP. As I understand, you are placing an instance of MyPawn in the level and you want to assign that to a Pawn variable in MyActor. In this case you will also need to make an instance of MyActor and place it in the map. Once you do that, select the placed MyActor and you will be able to select the MyPawn instance as a value for MyActor’s variable.

Why you cannt select a default value within the BP editor is, at that point the class has no instances.But you are trying to assign an instance of another BP into that variable.But you must remember that during gameplay, this particular instance of MyPawn does not exist initially, it is only created during the gameplay. BUT the default value for any BP class must be done before you can put any actor into the gameworld. So in essence, what you are trying to achieve is ‘Put a non-existant actor (who may or may not be created) as the default value for this BP’.

But if you place an instance of MyActor into the map, this problem does not exist. Because in this case, the value assignment is deferred until actors are instantiated and you can have a valid reference.

Ah, dragging the instance from the scene outliner was the piece that I was missing! Thanks a lot :slight_smile:

I had the same problem. Thanks for answer mindfane!

Can you mark this thread as solved?

-thanks

Thank you!