Download

Changing variables through Blueprint Communication.

Hi, I am currently working on a smart elevator and starting with small basic functions such as going up and down when requested through “using” a button. At the moment I am struggling to try and have one button on the first floor where the elevator would then move and a button on the ground floor request the elevator to return back to its original position.

The way I have done it is setting a public array of floors which stores the Z coordinates as a float and by blueprint communication to my button blueprint, it will get the floor requested through a integer variable (which acts as a pointer to the array basically) in the button blueprint. How do I get my elevator blueprint to access more than one button blueprint? Thanks.

Turn it around. Instead of having the lift that has to know about X numbers of buttons, have the buttons each know about the lift.

You could do it with something like the button blueprint on BeginPlay does Get Actors of Class with your lift blueprint class, and if you have more than one lift look to see if it has a specific tag. Then fill a variable reference with the proper lift. That way when the button is activated you can just call LiftVariable > GoToLocation or whatever you need.

Thank you so much, Iv been messing with this for so long that my heads been clouded haha. Back on track now ^-^