Inconsistent referencing behavior

Hello There!

To start off with the UE4 I am creating a little game in which you have to bring glasses to tables, I am running into trouble sharing information between blueprints, I have tried to find a solution to my problem in many places but i dont understand what i am doing wrong.

I use:

-Glass_BP
-GlassesSpawn_BP (A volume with a little function that spawn the glasses inside this volume)
-TablesInformation_BP (Holds an array (TablesArray) of all the tables in the map)

When the glasses spawn I want each instance of the Glass_BP to access TablesInformation_BP and store the TablesArray into their own TablesArray_Ref.
In the Glass_BP I created a variable and made it off type object: TablesInformation_BP_C, I set the variable to public (open the eye box). Now I place one glass in the scene and in its details I set the default value of TablesInformation_Ref to TeblesInformation_BP. When I now launch the game, that one Glass_BP I placed in the scene by dragging does not fail when casting BUT does not have any information in its TablesArray_Ref. And all the glasses created by the SpawnGlasses_BP are not even capable of casting and their default value for TablesInformation_BP_Ref is empty.

What am I doing wrong? I have looked in many places for three days already but I cant seem to figure out my mistake :frowning:

Thanks a million for the help!

0911efca91492128457e5bfa3cab6c1c2991d142.jpeg

can you see the helpless look in his eyes!!?

53a3b7d3d289f0a375252e0f7fe41c225c634f4d.jpeg

By changing the locationof the cast function (from Contruction Script to Event Graph) in the glass_BP the glass that was placed in the scene is now able to access the proper information, the only question remaining now is:

How do I allow the glasses that are spawned by GlassesSpawn_BP to also refere their TablesInformation_Ref to TablesInformation_BP?

Thanks!

I found a solution, I dont know if this is a proper way of doing things… but it seems to work! :smiley:

I am sorry for posting a question and finding the answer myself, maybe it can still be helpfull for anybody else.

6991ed9979bb55e447d684b70ec5f40045d2018a.jpeg

no need to be sorry, you are doing a good job. there is something you can consider:

  1. to get TableInformation_BP you can do it during construction script, for any BP object that wish to use it later after game started.
    2.you can always make the _Ref variable editable and either drag drop or select existing objects from editor.(if the object is a level object show up in outliner)