Is it possible to get the collision hit position - of objects that hit another object - while “ignoring” the actual collision = the one object should fall right through the other - I just need the actual hit position.
On Hit events are only generated by the physics collision system so with the physics collision disabled no on hit events will be generated. Instead you can use Overlap events or Traces and Multi-Traces such as MultiSphereTrace or whichever shape you want.
I preferred the tracing because it gives you detailed hit information. You do have to use some vector math or for a simple example you could attach two sockets for start and end points to your object and use GetSocketLocation to get your start and end vectors for the trace. For testing make sure if you sphere trace you set the radius because it defaults to 0, and also enable drawling for a duration so you can see your traces.
Thank you so much for both your replies.
I did not get notified about replies - so i tried a few things myself - and i even asked a new question before i noticed these replies
But - just to make sure - does any of the above suggestions work on chunks from destructible meshes?
Basically - i have chunks from a DM - that i need to fall - with usual gravity physics - and then when it “hit/overlap” some place it should do something - like emit particles - but it should not be “stopped”.
When i use overlap effect - it does not seem to work with DM chunks.
When i use hit - it stops the DM chunk.
When i try to attach anything to socket of DM chunk - it does not “follow” the motion of the DM chunks… it is just static.
I have attached image of the simple blueprint i have.
What you are asking to do is not viable with blueprints. You will have to use c++ or an alternative approach.
A possible alternative is to ditch the destructible mesh and just create your own blueprint with a destruct function.
Then create a broken object blueprint to spawn in multiple pieces and delete the main actor when calling the destruct function.
Honestly without explaining what you are trying to achieve, it’s difficult to make a proper recommendation.
Hi again Raisonbran - thanks a million for your reply. Very happy to hear from you.
I will gladly tell you what im trying to achieve.
It is a VR experience - thus i need a very high framerate
I “point/shoot” at a cliff wall - and that spawn a radial damage force - that damages this desired small circular part of the wall = it releases the smaller chunks that fall towards the ground.
I basically then need them to “hit” the ground - and preferably release particles - but then sink slowly into the mud.
Or fade away - but it can not be too heavy…
If the above approach that i tried now is not possible i have setup one previous version - where i just set the crumble smallest chunks - and then when it hit the ground - it disappeared - and i could use the hit position to release particles. I know the same is possible with some setup for Nvidia Physx - but im not able to find info on how to make that?
So in that version i had 4 depths (0-3) - made with Nvidia Apex Physx lab - and i needed to shoot “small” holes in the wall - and see the many chunks falling. But for some reason if I hit one area - it did not break at all - and if i hit another area it destroyed a very big part. Do you have any knowledge why this will happen? I assumed it was because of the chunks in depth 1 - was very big - so for the radial damage to spread enough to make a hole in depth 3 - it had to be very big radius - which i did not want. I tried playing with minimum fracture depth also - but with no luck.
Now i tried with a simpler smaller wall - with just this 0 and 1 depth - this one made in Unreal - and now - if i use same approach - I am not able to release the chunks - without making them crumble.
If i use too little damage - it does nothing on the wall - and as soon as i use “enough” it crumbles/removes the chunks completely.
Is there something im missing with the damage setting? I think i have tried all combinations of settings - but without good result.
Ok so I made a simple DM and did some testing and you can get the effect you want in blueprint.
You do not need to disable physics or collision on debris. Not Yet, I will explain. All the debris are child elements to the DM. So anything you do to the DM will effect the children.
Your object can have hit events and physics enabled. After a delay you can disable physics and collisions and use MoveComponentTo to slowly move the object through the floor.
That setup was done with a single blueprint DM object that fragmented completely into pieces.
Maybe you can do something different for the big wall, and spawn in smaller DM chunk blueprints that will completely break and use the above solution. I’m not sure, you will have to experiment and research further.
I cannot offer any more specific help for your problem, but hopefully the knowledge of how to manipulate DM debris will give you some ideas and point you in the right direction.
Hi Raisonbrand - again thank you so much for your help.
I understand why you can not use too much more time - but i hope you can answer these few hopefully simple question.
As I understand it you want me to:
Break my “wall” into one “simple” DM with only the biggest chunks - and when this is hit - a chunk disapear - and spawn a child DM that is already “broken” into many pieces - and this DM must have same initial shape and transformation?
These pieces now fall to the ground - and hit with particles and collision - and after delay i stop physics and move entire DM down…
This is great suggestion - thanks a lot.
I know how to get array of location of the DM chunks - but how to control which chunk emits what new child DM?
Also - how do i spawn a DM - with chunks already “broken free” - if i need to use one radial damage more - i will most likely also make impact on the main DM?
If you built your wall out of separate DM brick blueprint “chunks”, then you don’t have to spawn in pieces, they are automatically created when you break them, because you fragmented them previously in the editor.
If you completely break the DM into the end pieces, then the parent mesh is not visible, and anything you do to the parent which was the large “brick” before, is done to all of the child pieces. So you don’t need to access the individual pieces.
The brick blueprint would be responsible for hooking the fracture event, waiting for something like a time delay or pieces to settle, and then disabling physics, collision, and moving itself down the Z axis however far, and finally destructing itself.
Then in your editor, you could take that single brick you built and duplicate it to stack them up. The size of the bricks and how many you need is going to be a balance between how detailed the effect is and how much resources and performance are dedicated to essentially a wall.
You may still want to track the pieces locations in the blueprint of the DM object though. Because just because it fragmented doesn’t mean all the pieces are on the floor. They could be falling or rolling around. So if you just wait a delay, they might suddenly stop in the air and start slowly moving down however many units until just disappearing. If you track all the pieces, you could wait until they all stop falling or fell past a certain depth in the case one is falling forever. Then you fire the cleanup logic to animate the debris away before deleting them.
That may be a solution, depending on how large the wall is you may have to come up with tricks to optimize. That’s all for you to play with and decide.
It will certainly work and give you the effect you want.
Sounds like you have this to play with and some of your own research to do.
You should research UE4 destructable walls, and maybe slicing procedural meshes, or other methods.
Some other ideas for optimization. Maybe instead of the whole wall built out of destructible material, only portions of the wall are destructible and tie in to just standard wall assets, or there is a “finished” plating panel that can be destroyed to reveal the already damaged wall with chunks missing that was just hidden by the plate and revealed after it broke and fell off.
Hey glad to help. I came across this as well which might also be helpful for optimization.
So if you use PhysX labs or APEX plugins for 3DSMax / Maya you can create more advanced destructible meshes giving you more control.
They recommended deleting chunks when they break off which you can set using the more advanced editors.
I think this could work quite well because then you only need to spawn in additional actors for destroyed chunks instead of every fragmentable piece. That will cut down on the blueprint actor count and scale much better with larger geometry.
Very interesting issue. I have enjoyed tinkering with it myself. Hope this helps.