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.
asked Mar 18 '15 at 05:37 PM in Blueprint Scripting
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:
Hope that helps!
answered Mar 19 '15 at 02:07 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here