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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How do I notify a blueprint of another objects event firing?

I need my gamemode blueprint to know about a specific event occurring in another blueprint in the game to modify the score of the game.

I was going to use broadcast until I saw it checks every object in the game if it needs to know of the event. Seeing as only a maximum of four objects in the game can fire this event and only the gamemode needs to know about the event it seems like it would be very inefficient to use it.

What would be the best way to go about this efficiently?

Product Version: UE 4.11
Tags:
more ▼

asked May 31 '16 at 09:41 AM in Blueprint Scripting

avatar image

Tohaveaname
31 4 5 5

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

1 answer: sort voted first

If you only want the GameMode to wait for 1 other object to send a signal, you need Dispatchers. How to implement it? You create the dispatcher on the blueprint that is going to send the signal and Bind a custom event on the blueprint that wants you want to "hear" at that event (in your case, GameMode). This is useless if you got multiple sources that can send the signal, on which you will need to use Interfaces. The difference is that on Dispatcher, the sender doesnt needs to know where he is sending the signal but the reciever needs to bind himself to the sender. The Interfaces works on the opposite way. you implement the interface on the reciever (dispatcher is implemented on the sender), then the sender uses a reference to the reciever and connect to the Target of the node and executes the event. The good thing about Interfaces is that they are more flexible, as you can get a result from the call, where a dispatcher only fires an event, and gives nothing back. Now...that answer is for the exact question (since you ask for object to an unknown blueprint), and Interface (as far as i understand) can become a little heavy on the performance if implemented on too many objects (dont quote me here, im not 100% sure) but in your case you want just the GameMode to be notified for a change. why dont you just add a simple event on the GameMode and call it on the end of the logic on that blueprint? even if its multiplayer, you can add an event to that same blueprint to be RunOnServer and then that event send the signal to the GameMode (since clients cant access GM directly). and not only that but i think you should store the score of the game on GameState. again, im not sure if this is for single or multiplayer but storing variables in GameMode that should be accesed by everyone will become troublesome if you want to access to it.

more ▼

answered May 31 '16 at 11:24 AM

avatar image

jblaswu
813 21 11 46

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question