I need to share a variable between 2 BP

Hello! i need to share a “hit” variable between 2 BP. one of them is enemy, and second is weapon. to check this variable in second BP ( 2 screenshot). How to do it? i really dont understand how to cast between 2 BP ((( becaue get player character is not work…

Not gonna lie, that is an extremely odd naming scheme. “Pistol Hit” is actually a reference to your 3rd person character enemy and the “Hit” variable is located in “3rd Person Character Enemy_2”. So a couple things could be wrong with that reference you might not be referencing the exact 3rd person BP you think, the “enemy_2” seems to suggest you have multiple similarly named BPs. Additionally where did you actually “create” the reference? You should have had a cast node or overlap or something to make that reference variable actually point to something. As it stands looks like you just hit the “variable +” button on the left side panel and created a variable with no actual reference to an in game object. You can’t make object references the way you would a boolean or integer variable.

i made a reference variable, name “pistolhit” in pistol BP and reference it with enemy BP. from here i take a “hit” variable that was in enemyBP (1st screenshot). But its not work…

Thanks its work!!!

You need a reference to the Enemy BP from the weapon if you want to get a variable out of the enemy and modify it within the weapon. I am not really sure what exactly the logic is behind what you are doing but I am sure there is an easier way. I don’t even know what the second screen shot is supposed to be showing. A little more clarification would be helpful. Also this is the 3rd person BP and a “Pistol BP” which is the “enemy”?

Glad you figured it out.