Download

Event hit won't work

Ok, i’m trying to create an arrow, the arrow should ignore the capsule but not the mesh, the physics asset on the mesh have a damage threshold, which will multiply the damage(a “headshot” , for example, i’ve set to deal 5 times more damage). The damage is applied on the event hit.

The thing is : The event hit will only work like this if i have physics enabled on the arrow mesh, but if i have physics enabled the projectile won’t be launched.
Any ideas to fix?

Projectiles are a pain in the behind. Extremely complicated. You have to make their own collision class in project properties under ENGINE - COLLISION called projectile. You’ll need more than this tho.
I have for projectile for my own, projectile_ai, enemy, trigger, player, headcollision, pickups and finally weapons.

It’s a tangled mess but many of those have to “ignore” each other and others have to block each other. example is “projectile_ai” ignores “enemy” collision.
At this point you are simply arranging who can collide with who.

This is my code for AI doing damage to me with their projectiles…FROM their projectile blueprint. Don’t think of the damage giver as an animation or the weapon. its the projectile that does the oncomponenthit. so you see i have variables for dmg that make it easy to change the numbers later…if you have different enemies doing different damage, you’ll need further instances of this same projectile blueprint for those enemies
456a8deda77a303eb5251e7ad2444b4b81ed978e.jpeg

this will basically apply to your own projectiles but it may be different for you because mine stick in my enemies so i can enjoy watching them die with stuff sticking out of them for emersion! :smiley: hehehe
You can see its mostly the same thing though. This last pic also shows object type headcollision and how its set up to collide or not with other actors or things in the world.

now headshots, you saw i have an object type headcollision. This means i have a collision sphere in the AI character viewport surrounding the ai’s head. This means that headshot handling will be done in my AI characters blueprints and NOT the projectile!
BASE_AI blueprint

and finally…have a look at this short clip i just uploaded to see that code in action. my projectiles bounce off walls allowing kills around corners and also stick in the enemies (sometimes)

I hope this helped you (theres also an arrow trajectory tutorial somewhere in youtube i saw but it didnt work for me as it was a very early version of UE4 and didnt work in 4.9

you can use the mesh

make also one for enemy so you can separate collision differences of actors from your enemies.
make

I was already doing as you said, the problem seems to bee different. Let me explain better my setup, i’ll post som ScreenShots if necessary.
The mesh has it’s own collision channel and it blocks everything, the character mesh uses it for the Object Type on the collision preset, it has his own collision respones(and yes, it blocks the projectile type).The purpose for this is when some part of the body is hit, e.g : the legs , the damage is multiplied by the physics material destructible damage threshold that i’ve set on the physics asset parts, with this i can diminish the damage if a “”“minor”"" part of the body is hit, or multiply it by a lot if a critical part is hit(neck or head). The other purpose of this Collision Channel is to be able to make things ignore the pawn type(capsule component on characters) but don’t ignore the mesh. With this i can use raycast that will hit the mesh instead of the capsule component, doing what i previously said and get the damage multiplier result as expected.
But now i wanted to create a Bow weapon type, obviously, an arrow doesn’t go as fast as a bullet and for realism i’m trying to use a projectile that is spawned at a location (from the bow, but it doesn’t matter).
When i was using raycasts for bullets, it was 100000% fine ,had no problem.
Now that i’m using a projectile, i’ve set a projectile collision channel to mirror the effects the raycast could get (ignore some objects, in my case, the pawn, a.k.a capsule component).
The projectile collision i have blocks everything, and the projectile uses it as the Object Type, and for the collision responses it blocks everything but the pawn (the capsule component). The problem is : The event hit from the projectile completely ignores the mesh channel if i’m not with simulate physics enabled.
What could cause this?

I found a workaround. As i said, it was working fine for linetraces, i simply made the event hit launch a linetrace and the trace hit do the damage stuff.