Hi again ! You are definitely getting a special credit should this game ever release at this point
Small issue: I enabled “Simulate Physics” on my projectiles in order to utilize the OnHitEvent to spawn bullet holes. However, the bullets now drop right out of the gun and onto the floor:
Hey there @anonymous_user_3cf2ac1c! So one thing about the projectile movement component is that it doesn’t use the physics system (mostly). It actually handles it’s own movement and it’s own “Gravity” totally separate from the built in physics system with it’s projectile movement component. So what happens is that when you enable physics sim it’s actually separating itself from it’s root object, and if it is the root object it’s also going to ignore other modes of movement.
To use the Event Hit you don’t have to have simulate physics on. The First Person Shooter default bullet is an example of being able to use it, as well as direct on other components under the actor.
Looks like Rev got you going before I got back in today, awesome! As Rev said, it’s likely just being destroyed before the decal is spawning, though if it is going too fast for the hit detection, you could use Continuous Collision Detection, but it’s rough on the CPU so probably not great for too many actors with it to be active at once:
So I removed the do once and moved the destroy actor to 2 on the sequence. Still had the same issue.
I would move the collision mode to query only but I want this FPS to be as realistic as possible and therefore use physics too. (I am a noob and don’t fully understand all these mechanics)
CCD did seem to solve the issue, besides a hole or two appearing on the ground but I think that was an issue with the wall I was shooting.
Oh yeah CCD is really not optimal if you’re going to be pumping a thousand of these things into the air. It’s most often used for things that need to happen with extreme reliability at high speeds but not hundreds or thousands of them. Say this was a feature on only your snipers? (battlefield?) Then I’d say it shouldn’t matter much in a stable and optimized singleplayer environment.
Old school workarounds include slowing your projectiles down a bit, Stretching their collision long ways to give them more frame time passing through objects, tracing to predict where it could feasibly pass through without connecting (it’s redundant but you can), or if your shots really need to go so fast that they will always clip, much of the time developers opt to use traces instead.
Secondly physics collisions are nice, but you’d have no control over your impacts and how they knock things around. Query only is just better in the sense you can control exactly how much you want something to move, which direction, and even account for your own mass/speed if you’d like. Realism isn’t what you get from using built in physics, you get unpredictability, which is pretty close to realism until you see that for some reason your 10lbs rock just launched a 2 ton mech into the stratosphere! For other objects like ground objects, then yes you can totally still influence them with query only and sending the impulse on your own!
Would you put the line trace at the end of the bullet?.
Ive moved this BP with a shotgun pellet-based gun. Even though the Object Type is Projectile and set to ignore other projectiles, how come the pellets still destroy after each other after the shot? I know its the destroyed actor becuase it works fine without it. just a bunch of pellets rolling around… which is realistic…but not optimal. Thoughts on how to fix?
If you were going with the “predicted” missed hit method, then yes at the front of it, usually based on how fast you have it move. This is effectively the same as stretching it out, but only pinpoint in front of it. This also only works if your projectiles are oriented to it’s movement or you do the math and get the movement vector. That said, you will be tracing every frame so it’s still not the cheapest option, while cheaper than CCD I’d likely try slowing the bullet, then stretching it’s collisions first. Sometimes things don’t have to move quite as fast as we think.
Are your pellets all the same and have ignore for their responses so the projectile object type? If so you may need to take the hit event and break the hit and print what object killed each one to verify that’s making contact.
Oh wow they are definitely making a connection haha, alright so question: Does both your root object (the sphere collision) and the mesh have collision/overlap on? If the mesh itself is there it may also send hit events. Otherwise it should never make contact with each other like this:
The bullet hole isnt registering on the correct surface once initial speed is past 1000 but it works. Even with CCD! (Also couldn’t get it to work using just quing and not simulating physics) but ill take it.
I SWEAR YALL ON THIS FORUM ARE THE BEST!!!
I would have given up on this project long ago without your help!
It’s definitely going to take a bit of tweaking with a mix of the fixes I listed before to get it just right. Once you find your balance you’ll be able to apply it to most of your projectiles.
Haha I’m glad you’re satisfied! It’s what we’re here for. Trust me, we’ve all been there. First big project, lots of unknown unknowns. If it doesn’t work out, let me know and we can try to find you a different method!
Yes, it was the skeletal mesh that was triggering the collision. As for the bullet holes I’ve got is semi-working by tweaking the radius, was correct when he said that a collision sphere (maybe not specific too sphere) radius below 10 starts to cause issues.
I’ve managed to get this without CCD:
Just need to figure out why it’s hitting on the back wall and LOD? for the draw distancing.
But I love being able to see the pellets as they fire out. VERY VISCERAL.
So if you’re using standard decals they have a Fade Screen Size value, that the further you get away the more they fade. A good one for games like yours is roughly 0.03
It also depends where the collision is being caught, if the center of the collision is 99% of the way through the wall it’ll likely spawn the decal closer to the back, which usually means the decal with show there. Also the Decal shape might be large enough that it hits both sides. It looks like that since some of them are faded and some aren’t.