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"

Can not set default value of object reference variable

I can not get my variable "newvar_0" to have it's default value set to the object pawn "Dhunt_camera". The only way i can get the variable to work properly is to click each instance of the object using the variable in the level and manualy set it's value to the camera from the level. However, this will not work for an object that is spawned later since it can not find a default value. alt text

alt text

Product Version: Not Selected
Tags:
more ▼

asked Mar 18 '15 at 05:37 PM in Blueprint Scripting

avatar image

Hunkuleswjc
16 5 6 9

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hi Hunkuleswjc,

You can't create a default value for an Actor that doesn't exist yet! Instead, you'll need to get a reference during runtime after it is spawned, and then save the reference in your variable. You can do the same thing for your Actors that already exist in the level in the Construction Script, if you would like, instead of setting the Editable value for the instances in the Viewport.

To do this, your best option is to use some variation of the Get All Actors of Class method. You can read about a few of these options here:

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/FindingActors/Blueprints/index.html

Hope that helps!

more ▼

answered Mar 19 '15 at 02:07 AM

(comments are locked)
10|2000 characters needed characters left
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