x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Object reference property

In my Player Controller class I have a pointer to object (AVolume):

 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
 AVolume* BattlefieldVolume;

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?

Product Version: Not Selected
Tags:
more ▼

asked Mar 31 '14 at 06:36 PM in C++ Programming

avatar image

Moonwalker On The Mars
3 1 4 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Mar 31 '14 at 06:54 PM

avatar image

[Epic]Ben Zeigler STAFF
1.3k 29 131 75

avatar image Moonwalker On The Mars Mar 31 '14 at 07:00 PM

Thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question