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 object pawn “Dhunt_camera”. only way i can get variable to work properly is to click each instance of object using variable in level and manualy set it’s value to camera from level. However, this will not work for an object that is spawned later since it can not find a default value.

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 reference in your variable. You can do same thing for your Actors that already exist in level in Construction Script, if you would like, instead of setting Editable value for instances in Viewport.

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

Hope that helps!