Object reference property
In my Player Controller class I have a pointer to object (AVolume):
But in the Editor I can't assign an object from my scene. I choose it in drop-down list or use "Pick Actor from scene", but nothing happens. What am I doing wrong?
asked Mar 31 '14 at 06:36 PM in C++ Programming
Moonwalker On The Mars
Controllers exist outside of specific levels, so you can't assign actors inside a level to the default properties of a controller blueprint. The issue is that the same Controller can be used in multiple different levels, so it wouldn't know how to refer to an actor from a different level.
A good way to deal with this is to set up a blueprint function on the controller to set that variable at runtime. Then, call that function from the level script blueprint with the appropriate actor reference. In the level script blueprint you can create a "begin play" event, call "GetPlayerController" to get the first player (or call it multiple times in a multiplayer game) and then assign the variable by calling that blueprint function.
answered Mar 31 '14 at 06:54 PM
[Epic]Ben Zeigler STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here