Download

Transfer a Number Between Blueprints?

Hi everyone,

I am wondering if anyone can point me in the right direction on how to transfer a number between 2 blueprints.

I want to set a variable in my level blueprint (preferably, if not then in some other actor blueprint), this variable would probably be a byte to use less memory (if not, then I could use an integer or a float) and it will be set to the number that I want to transfer. I then want to send this variable/number to my character blueprint so that I can then plug this variable into a node in my character blueprint.

That is how I would like to try and solve this problem but I have no idea what nodes, etc. to use. I’m basically just trying to send a number variable from my level blueprint to my character blueprint so if anyone knows of a simple way to accomplish that it would be great help.

Thanks!

You are better off to stay away from the level blueprint for temporary variables. It’s good for putting stuff in it regarding setting up the level. You can’t just access it from anywhere.

The GameState is what you want to look at. Make a blueprint based off that and in your project settings, set your new one to use it. Any blueprint can get the GameState, and then you cast to whatever it is that you called yours. You have access to everything on it from there.

You don’t need any special setup for Blueprints to “talk” to each other. You can use the Interface, but that’s choice. Just make sure the variables are public “editable”. Or, you can make functions that get or set variables and use those.

Not the right way to do it: In the level blueprint, you could get the player character and set something on it. You can’t do it the other way around and try to get the level blueprint form the character. But, it’s not the best way to handle it.

Thanks for the clear explanation, very informative and helpful. Cheers!