Sharing Aximmetry variables from Level Blueprint to other Blueprints

 

Hi,

I am learning Blueprints, and encountered an issue, which I am very eager to solve.
Basically I would like to control the material properties of a material instance using Aximmetry (change opacity), but I cannot find a way to share variables between blueprints. (Controlling the materials on objects through dedicated blueprints (Let me know if this approach is the best))

Looking for Blueprint communication I found many different tutorials, with tons of different approaches, all leaving me confused, since all the tutorials assume you are making a game.
I have a bit of experience in coding in C++, C#, and it seems maddening to me how difficult it is to work with global variables inside Unreal.

I am posting here since Eifert seems like a solid guy answering the questions, and I really want to know the Aximmetry Approved method of doing such things.


Also, in my experience it is only the GetAximmetry nodes and variables that I place in the LevelBlueprint, that show up inside Aximmetry. Is that correct?

Thanks for your answer, and let me know if I should clarify anything!


   speakerbee

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

There is no Aximmetry approved way to do these things. And yes, Unreal Blueprints can be quite confusing with their strict object-oriented design.
Personally, it can be quite confusing for me too, so you might have better luck on the Unreal forums.



In general, you should keep these things in mind:

When you create a blueprint in Unreal, it is not included in your scene (level-map). It is just located in the Content Browser panel of Unreal and Aximmetry won't create pins for the Get Aximmetry ... blueprint nodes in it.

When for example you add an Actor Blueprint to your scene by drag and dropping it into the viewport of Unreal. Then this blueprint object will appear in Outliner panel of Unreal. And blueprints in the Outliner panel with Get Aximmetry ... nodes will appear as pins in Aximmetry.
However, this is true if these objects were added to the Outliner in the Unreal Editor and not dynamically created. There is a trick to circumvent this, I talk about it later below.
Also, if you have added a blueprint twice or more to the outliner, then there will be still one pin in Aximmetry for their Get Aximmetry ... nodes, but both blueprints will receive this pin's values.

Blueprints can not reference anything in the Outliner, except the Level Blueprint. You can drag and drop any object from the Outliner into the Level Blueprint and you can edit these objects from the Level Blueprint. Also, Get Aximmetry ... nodes in the Level Blueprint will appear in Aximmetry as pins.


Likely, the Level Blueprint is enough for you as the blueprint that holds global variables and writes these global variables into other objects.
However, other blueprints won't be able to refer to the Level Blueprint. So inside other blueprints, you won't be able to have a node that gets the variable of the Level Blueprint, instead, you can have a variable in the blueprint that is written into (updated) by the Level Blueprint.
If you want to have a global variable that has get function, then you probably want to use a Game Instance blueprint. There is a small tutorial about Game Instances here: https://couchlearn.com/how-to-use-the-game-instance-in-unreal-engine-4/

There is actually a small trick to have pins for dynamically created objects (for blueprints in the Content Browser). You just add the same Get Aximmetry... node to the Level Blueprint. You don't even need to connect it to anything:
This way, Aximmetry will create a pin for this. And the dynamically created object will get this pin's value.


Note that pins will appear in Aximmetry in Live Sync even when the project is not cooked:

This way you can test things fast as you don't need to cook. And you don't even need to stop the project (compound) in Aximmetry.

Warmest regards,