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"

UE4: Add hit event to dynamically added sprites.

I am trying to make a dynamically added sprite bars and detect collision for each of them when player steps on them, when collision happens - it will randomly decide to collapse or not.

I am having trouble detecting collisions for them, or more precisely - firing collision events, in my blueprint event graph - none of the events detect any collisions (I assume because they are dynamically added).

Floor bars: alt text

My blueprint for dynamic adding:

alt text

Product Version: UE 4.15
Tags:
more ▼

asked Feb 21 '17 at 08:10 PM in Blueprint Scripting

avatar image

arleitiss
12 1 1 5

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

1 answer: sort voted first

I dynamically add Paper2D sprites in my games all over with no issues w/ Collisions. But getting them all sorted in the first place is always tricky. Manually rez them in your map and run into them to test the hit/overlaps work the way you like and then you should find the dynamically added ones work fine. I usually add a sprite on the map, fiddle with all the params until it's working right, then promote it to a blueprint, and dynamically spawn instances of the blue print. Good luck! Oh and if you haven't seen, you can set up custom collision groups in your project and then select those in each blueprint. Then if you need to fix something later, you can make the change in one place in project settings. I start off making several in every game like "Ladder" "Platform" etc.

Go to Edit > Project Settings... > Collisions > Presets > New...

more ▼

answered Feb 21 '17 at 08:26 PM

avatar image

Furroy
696 26 86 61

(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