So I just went from Line traces to actual bullets in my game and I’ve run into a few issues I’m not sure how to handle.
The On Hit event on the bullet is not always triggering when hitting another actor. It does sometimes but tend to fail frequently. I check a few other threads and they said to turn on “Simulate Generates Hit Events” on both the bullet and the Target. This didn’t help though.
Instead of actually triggering the script when the bullet hits it instead sends the target flying backwards. Where or what should I look for to prevent this? I’ve tried to change the mass of the projectile and target but I guess there’s still some kind of hidden force calculation or friction modifier I need to adjust to prevent this.
The collision on both bullet and target are set to Block All.
It’s spawned like this with the aimpoint being outside of the collision capsule of the soldier fireing the bullet (with some modifiers to get some randomness to the trajectory)
This is needed when simulating physics, here the projectile movement component emulates it internally. Besides, you’re getting some hits.
not always triggering when hitting another actor.
Can you give us more details regarding the scene setup?
how large is the target actor?
are you shooting at something very thin?
is there anything unorthodox going on?
things are being moved around?
how does the bullet component hierarchy look like?
I’ve just tested it with the velocities you have punched in and got 100 out of 100 hits against a static wall.
Instead of actually triggering the script when the bullet hits it instead sends the target flying backwards. Where or what should I look for to prevent this? I’ve tried to change the mass of the projectile and target but I guess there’s still some kind of hidden force calculation or friction modifier I need to adjust to prevent this.
You probably have Simulate Physics ticked on the root component of the bullet actor. No need if we’re using a projectile movement component. Now, thinking about the above, I’m almost certain those issues are caused by trying to simulated physics and using the projectile component simultaneously:
By default, the physics sim is not using CCD - at those velocities, without the component’s aid, you will get inconsistent results.
The target (an enemy soldier) is about 1.8m tall and got a capsule with a radius of 34. So more or less like your avrage Unreal manequin.
Nothing unorthodox going on. Enemy soliders approch friendly soldiers. Detects them, stop and shoot. Bullet spawn, travel and hit. Friendly fire can occur but shouldn’t give a different result.
I guess this is the bullet hierarchy
Simulate Physics is not checked on neither Bullet nor Soldier.
Soldier
Bullet
Cheers! That seem to have fixed the issue.
It messes up the look of the projectile though…and I have to find the option for bouncing again
But that’s another issue.
Now I think it’s the size of the bullet that messes things up.
The visual looks of it got squished and it keeps getting stuck in the soldier shooting it, so they kill themselves. So need to tweak the size and see if that helps.
Check the scale of the bullet mesh component (it can get messed up when reparenting comps). And disable collision on the bullet mesh - it does not need any.
The visual looks of it got squished
Also check the Aim Point scale since you’re using its transform - who knows what scale we’re feeding the actor.
and it keeps getting stuck in the soldier shooting it,
Here’s where the collision filtering comes in handy. Or perhaps it’s enough to offset the Aim Point a bit more so the Collision does not catch the gun / player capsule.
It was the mesh collision that made the soldiers hit them selves.
And the scale of the projectile is starting to shape up as well.
The aim point is mearly rotating an arrow so shouldn’t affect anything except for the initial vector of the bullet.