Call function from one Blueprint to another with problems

why are you reposting the question? i had responded to your question elsewhere but it seems you decided to delete that question and post the same thing again.

your script doesnt work because of how you are getting a reference to your elevator actor. your currently using a get all of class node then getting index 0 which is the wrong way to go about getting a specific actor reference. just think about it your getting all actors not just one.

so to fix your issue you need to come up with a way to reference a specific actor. there are many ways to do this via traces, overlaps, variables, etc. the question is where are you creating the widget? if your creating the widget based on say a overlap with the elevator then its a simple matter to set a variable in the widget when its created. this variable in the widget will then be the reference that you need. but like i said before it depends on the situation and where the widget is created.

Does anyone have a solution? I’m trying to call function from a HUD Blueprint to trigger event in a blueprint (elevator) or unlike, I put the HUD WIdget inside the Blueprint elevator and add in the level, worked correctly, but when I add more than 1 blueprint (elevator) within the level when I press the HUD of the first blueprint it calls the second blueprint and does not call the first, but this does not happen with the second that works correctly. Does anyone have a solution?

watch the video: - YouTube

Download the link project: GitHub - asfe-0k/CallfucBpue4: Call function from one Blueprint to another with problems

Who has the solution could send the blueprint again with the graph?

i have no idea what your last comment is meant to say. it seems like your still trying to use the get all of class which is the wrong thing to do. you have a situation here where you could use some easy direct blueprint communication which would be simple, reliable, and performant, take advantage of it.

And how do I make the blueprint create index value for the graph (get a copy) always when the begin play event is called it creates float value and references if there is already a current value and generate a value above that?

below is an example of all the code needed to create a elevator that moves based on button click in a widget.

as you can see in the first picture on overlap we create the widget, and set the elevator reference variable (elevatorRef) in the widget. thats a simple way to set a reference. the end overlap event is just there to destroy the widget is the player chooses not to use the elevator. then theres the up and down functions which just move a mesh based on a timeline.

in picture two you can see the on click events for the buttons in the widget. here when the up button is clicked we get the elevatorRef variable which we set earlier and call the up function in that actor, then we destroy the widget (im assuming a 2 destination elevator here). the down button is basically the same.

so how this works is the player overlaps the elevator, the widget is created and present on screen, the player clicks a button which calls the event in the elevator bp, then the widget is destroyed while the elevator moves to the next floor.

again this is only one example and there are many more ways this can be done and theres many ways to add complexity and more functions.