x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] Call function from one Blueprint to another with problems

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: https://www.youtube.com/watch?v=UMzrrm2CACo

Download the link project: https://github.com/asfe-0k/CallfucBpue4

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

Product Version: UE 4.21
Tags:
more ▼

asked Dec 01 '18 at 09:53 PM in Using UE4

avatar image

TheSubZer0
114 7 11 16

avatar image ThompsonN13 Dec 01 '18 at 09:59 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Mar 08 '19 at 11:46 PM by TheSubZer0 for the following reason:

The question is answered, right answer was accepted


1 answer: sort voted first

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.

more ▼

answered Dec 01 '18 at 10:08 PM

avatar image

ThompsonN13
10.1k 33 9 23

avatar image TheSubZer0 Dec 01 '18 at 10:25 PM

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?

avatar image ThompsonN13 Dec 01 '18 at 10:48 PM

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.

avatar image ThompsonN13 Dec 01 '18 at 11:05 PM

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.

alt text

alt text

capture.png (324.9 kB)
capture1.png (149.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question