Download

setting pawn variable (c++) from level blueprint

Hi all,

CubesManager.h inherits from Pawn class.

In Cubesmanager.h :


public:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Matinee)
		bool MatineeIsOver;

I created a blueprint called “CubesManager_BP” which inherits from “CubesManager” class.

I have a matinee sequence when my level loads, and when the former is over i want to set MatineeIsOver to true in my level blueprint. But the issue is :

http://img11.hostingpics.net/pics/1234801727.jpg

Notice that the GET node output is the exact reference i need.

Any idea ?

The error is quite clear: Pawn (alias APawn) reference is not compatible with Cubes Manager (alias ACubesManager) reference. Since the latter inherits from APawn and not viceversa, it doesn’t make sense to access a variable declared in ACubesManager from a APawn reference.
What you need is a **cast **from APawn to ACubesManager

I don’t understand because GET node output is a CubesManager class reference so it should work, but i did what you said and it works like a charm. Thanks Sneppy

Happy to be of help :smiley:

Note that you are explicitly requesting all actors of class APawn, you should simply set the actor class to ACubesManager in the GetAllActorsOfClass node (and then you would not have to cast)