I have gotten this to work like 10 times already in my lifetime but then i forget the routine
I have a bullet flying towards the basic third person character mesh unreal guy.
Mesh has simulation generates hit events
Collision preset is character mesh
It has on component hit event which for some reason seems to work if another unreal guy spawns on top of it
Then there is the bullet and i set its collision preset to BlockAll
Also tried custom…PhysicsBody
Doesnt work. They dont generate my print “Hello i hit something” or anything else either
Here i am once again spending 5 hours trying to understand this simple thing. I bet i can make it work with collision capsules but thats not what i would like to see as hit events have impacts and so on
on hit do a branch for blocking hit bool. if true cast to Third person character and do a branch to see if it is hitting that character and if true and do your code. it helps to to a destroy actor if false too so it doesn’t just sit around the map.
To this day I have no idea what ‘SimulationGeneratesHitEvents’ does as having it off I still get hit responses…maybe something to do with physics…
Here’s a method for you:
(Optional) Create a new trace or object channel in ‘edit - project settings - collision’ , in this example I’ve created channel ‘Projectile’
I’ve got two blueprints in the example, BP_Coltest and BP_Coltest2. BP_Coltest is basically a pawn, BP_Coltest2 is a projectile. (sorry i really should have named them something better thinking about it)
For the two objects to collide, click on the component, in this case a static mesh component, go to the collision settings for that component.
CollisionEnabled set to ‘Query and Physics’
Set your object type, for the pawn blueprint I’ve set it to ‘Pawn’ and the projectile BP is set to the new channel ‘Projectile’. You need to tick the ‘block’ for each BP, so in the Pawn you’d want to tick the block for ‘projectile’ channel. In the projectile BP set block on ‘pawn’ channel.
Then on ‘Being Play’ in the projectile BP, do a ‘get’ reference for the Static Mesh Component. Drag the pin from the static mesh component and search for ‘hit’, select ‘Bind Event To On Component Hit’.
Drag the ‘Event’ pin out and add a Custom Event. You can get all the hit info from that now:
I dont know why but it was the DefaultSceneRoot component that caused me to not generate any hits with any of the components, capsule collisions, meshes whatever. My bullet was just built on top of basic actor bp template
I was seriously thinking this is rediculous and the editor is broken because i generated overlaps and its like the same procedure to get those.
I think this might be a bug. With DefaultSceneRoot gone it works