I am currently experimenting with
Chaos Destruction in UE, and I would like to achieve a simple gameplay mechanic.
Let’s say I have a bottle, which I want to destroy and subsequently pick up its parts. How exactly would I do that? Is Chaos intended for such a use-case?
What I am already able to do:
I created a
GeometryCollection and fractured it. Once it falls to the ground it breaks.
But now I am unable to do anything with the parts. Each single “particle” is still of class
GeometryCollectionComponent and when I try lifting it, it lifts ALL the “particles” (with particles I am refering to the broken pieces of my bottle).
Could anyone nudge me into the right direction on how to tackle such a problem?
There’s probably an array or collection of the parts within whatever you are querying.
The parts react to collision, so I would run an overlap test and get the info on it - this can actually include the ID of the object in the collection.
Never actually done this with chaos, but the process should essentially be the same as for everything else.
Performance of chaos is still so. So, so bad that it’s not even worth putting time and effort into doing marketplace stuff with it. Especially when it comes to tons of items simulating all at the same time.
The other alternative (not to chaos, but to using the break system) is to craft a mesh that’s pre-broken and import it with separate parts.
You then build a blueprint that automatically spawns the other blueprint (with a different mesh piece).
And that way you can actually have each piece decide IF it can be interacted with via an interface.
You miss out on the “easy fracture” part, but you can also create 3 different fractured instances and randomize which version of the mesh is actually used.
If you want to interact with “everything”, than this is a bad suggestion.
If you want to interact only with specific items, than this is the best approach.