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"

Send Message To Specific Blueprint?

So I have a graffiti system that I need help with, when the player collides with the graffiti blueprint it sends a message back to the player which triggers a boolean, I did this because I didn't want to cast multiple times for different characters.

Once a key is pressed with this boolean on it then sends a message back revealing the graffiti one by one.

My problem is the message is being read by all of the graffiti on the level so no matter which one you collide with and spray on it ends up revealing all of them eventually

I would like to know how I could trigger this with sending specific messages to the colliding blueprint/doing this a better way since I'm not really sure how I would go about doing this

Thank you!

Product Version: UE 4.21
more ▼

asked Feb 03 '19 at 11:18 PM in Blueprint Scripting

avatar image

112 3 5 8

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

1 answer: sort voted first

is it just your player that can trigger the graffiti? if thats the case then you could simply use a gate to control the script flow and instead of casting to identify you just use a other actor equal (==) to player character.

or another less precise solution would be to use classes higher in the hierarchy for your casts. for example cast to character instead of a specific class.

butt to answer your question specifically to send a message to a actor directly you will need a reference to that actor instance. you can get the reference via overlap events, traces, etc.

alt text

capture.png (116.8 kB)
more ▼

answered Feb 04 '19 at 01:24 AM

avatar image

10.4k 34 10 27

avatar image Jinkuu Feb 04 '19 at 01:51 AM

Ok so if I were to have multiple graffiti actors within my level and I get the reference to that actor instance I would be able to set the bool to reveal the graffiti on that specific actor I collided with?

Right now the message triggers the bool on all of them

So I assume if I get the reference from within the player I can then send the message to that specific actor?

avatar image ThompsonN13 Feb 04 '19 at 03:53 AM

if you have a reference to the actor you want to affect then you can do anything you like to it, set variables, call events, etc.

though personally i like a system where all the functionality is contained in the actor itself. so i would go with something like the above or use a interface with a "use" event. having the script contained in the graffiti actor keeps everything self contained and declutters your characters graph.

avatar image Jinkuu Feb 04 '19 at 12:48 PM

I used your gate example and the overlap events to open and close work but I'm unable to press a key to continue the script

avatar image Jinkuu Feb 04 '19 at 01:23 PM

Ok I fixed this by enabling/disabling input based on your gate switch thank you so much!

avatar image ThompsonN13 Feb 04 '19 at 02:19 PM

no prob. another method you could have used as well was to select the input event and in the details panel uncheck consume input.

(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