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"

Having multiple actors able to trigger same event in level blueprint?

Hi! I'm having an issue getting multiple actors to trigger the same event in a level blueprint.

This is a VR project and in my level I have many snowball actors that I can throw at a target. I have a variable in my level blueprint that counts when the snowball hits the target. When the target it hit, the OnActorHit for that target is triggered in my level blueprint and the score is increased by 1.

In addition to having the number of "hits" counted, I also need to count the total number of snowballs actually thrown so that I know how many are missed. The snowball actor blueprints are each able to detect when they are thrown (so they can play a "whoosh" sound). Every time a snowball is thrown, I want that snowball to increase the "thrown" variable in my level blueprint by 1.

I've looked into Event Dispatchers, but they seem like they are used when a single blueprint needs to talk to many other blueprints, but not when many blueprints need to talk to a single blueprint like in my case.

How would I accomplish what I'm trying to do?

Product Version: UE 4.18
Tags:
more ▼

asked Dec 22 '17 at 05:02 AM in Blueprint Scripting

avatar image

Matt2468rv
3 1 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Instead of using the level blueprint, which can be a pain to communicate with, I would use a custom Game Mode. The game mode can be accessed from almost any blueprint. To communicate with the Game Mode, I would use Get Game Mode and Cast to the specific type of game mode. Or even better, I would look into using Interface Blueprints.

If you don't know, Interface Blueprints are amazing tools that allow a bunch of different blueprints communicate with a single blueprint, or a single blueprint communicating with a bunch of different types of blueprints.

link text

more ▼

answered Dec 22 '17 at 07:44 AM

avatar image

thevfxguy13
369 5 7 19

avatar image Matt2468rv Dec 22 '17 at 01:31 PM

Ok, I will give that a shot and see if I can get it working. Thank you.

I tried using a blueprint interface to communicate with the level blueprint but for the life of me I could not get it to work. Does the level blueprint intentionally impose limitations, and is it even compatible with a BPI? Is it generally a bad spot to store gameplay-related variables? I've seen tutorials where these type of variables are placed in the character blueprint. Is this generally a good practice or am I better off storing those types of variables in a custom Game Mode?

I'm fairly new to UE4 so naturally I have so many questions! :)

(comments are locked)
10|2000 characters needed characters left
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