Reading/Writing Variables

Could you give a little more detail on what you are trying to do? Accessing variables from one Blueprint to another should be easy, but you do need a reference to an instance to do it. There are lots of ways you can get this though - lets assume you have two BPs called Barrel and BarrelManager, and BarrelManager wants to change a variable on a Barrel.

  • Add a ‘Barrel’ type variable called TheBarrel to BarrelManager and make it ‘editable’ (click the little eyeball next to the var). Now place a BarrelManager and a Barrel in the map, select the BarrelManager and use the ‘Actor eyedropper’ to ‘fill in’ TheBarrel to point at the Barrel you placed. You could also change TheBarrel to be an array of Barrels and then iterate over them use a For Each loop.

  • Inside BarrelManager use the ‘Get All Actors Of Class’ node to find all Barrels in your level and modify them

  • Have the BarrelManager do a raycast or overlap check to find nearby Actors, then use a cast node to see if it is a Barrel and then modify it if so.

I hope that helps a little! I’m going to make another Quick Shot video tutorial on this topic soon I think.