I have made my projectile to simulate physics in order to add impulse to my destructible mesh. The issue I am having is that when the projectile hits the wall, it will keeping hitting the fractured pieces until it pushes them away, and won’t destroy itself until it hits any actors other than the destructible wall. Also sometime it will just go right through the wall. I am guessing it is because I did not specify what the bullet actor should do when it hits a GeometryCollectionActor, but I am not sure.
Hey @HHX1602. This might be a bug in Unreal’s Chaos System. I can’t say I’m sure though, but the code you have should consider any collision, since you are not discriminating by the type of actor, only that the other actor is not the same bullet.
I would add a breakpoint to see if the OnHit function is being called when you hit a GeometryCollectionActor. That will give some information and you will be able to see what variables you are getting from the hit and maybe do somehting with that.
If the OnHit event is not being triggered, then I would suggest a workaround for GeometryCollectionActors, maybe adding a trigger collision to those actors and triggering the projectile hit behavior when overlapping with that collision instead of the GeometryCollectionActor itself.
Oh, and also, you are calling Destroy() and then calling some more behavior after for spawning your vfx assets. Unless you have tested that your vfx is working correctly (which I don’t think so), you should call Destroy at the end of the function, otherwise your bullet will be destroyed before your vfx is spawned.
Hope this helps
Hi,
Thank you for the reply! I have tested the OnHit function and it is being called when the bullet hits the wall multiple times as long as it is still hitting a GeometryCollectionActor, however the Destroy() is not being called at all even though it is within the OnHit function.
I will see if there is any other way allowing the bullet to break the wall. Thanks for the info!
Just a quick update, I have managed to get it working by setting the SetSimulatePhysics() to false in the OnHit function right after the “AddImpulseAtLocation” line. The “Simulate Physics” option in the BluePrint Setting need to be turn on for the BulletSphere (Collision) component. It’s a temporary fix, hopefully someone has found a better solution.