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).
My blueprint for dynamic adding:
asked Feb 21 '17 at 08:10 PM in Blueprint Scripting
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...
answered Feb 21 '17 at 08:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here