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
That is exactly the reason why you can't set a default. The variable can not assure that this object exists during runtime. You need to get a reference from somewhere else (not a direct reference to the object by default or the level script). This can be achieved by spawning those actors, receiving them via "Get All Actors of Class", overlap / collision events or by passing down a reference from somewhere else. That's pretty much the very basis of object orientated programming.
I hope this helps a bit even though it does not actually solve your issue.
answered Mar 18 '15 at 06:03 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here