I plan to make use of UE5’s Chaos, and each static mesh requires a geometry collection/fracture. Would it be possible to programmatically create these (ie, I have a mesh component, and from there, I create something that is assigned to a geometry collection component), or does it have to be done manually?
As of right now, I have a blueprint with a static mesh that allows me to pick up/throw objects. When a break event occurs, it removes the mesh actor and spawns a corresponding geo collection actor, that has its geo component pointing to the right geo/fracture. Rather than having to do this for each mesh, it would be great to do it systematically! If my current approach is off, please let me know too
I don’t know if you can modify static mesh, it has to become dynamic.
Maybe Dynamic Mesh 3, I’m getting into it, you can use UStaticMeshComponent with it I think but also PMC.
So either of these two in combination with Dynamic Mesh 3.
Simply to modify data you have to load the vertexes from the mesh into a variable system or an array and from there it will flow as "Dynamic"to some component that is alive to read the vertex data that it is getting
PMC is pretty good too, you can then save it as a static mesh, convert from Dynamic to Static. You can fracture it with noise if that is what you want.
Don’t expect PMC to be accurate unless you modify vertex by vertex manually, then you got noise that will offset things for you in an area you like but what I see is that it’s not vertex by vertex when automating things with noise for a whole area, noise pulls on multiple vertexes from an area, as in you cannot displace only the vertex points that you like and others near it will be affected, this is for modifing a mesh in a more automatic way.
Same challenge here. I want to create geometry collections for a couple of asteroids. At some point, the asteroid meshes will be created procedurally and I want to set up geometry collections in Blueprint or C++ for all of them, including a fracture. No clue how to go about that.
I concluded that this is simply not the intended use of geometry collections and fractures. They are meant to be created in the editor and baked.
I am using the RealtimeMeshComponent free marketplace plugin now. It allows me to procedurally generate asteroids and I even wrote code to split an asteroid in half - at runtime. The splitting requires to do all the math by yourself, though. I.e. decide for every vertex where it goes.
I’m looking for a similar solution in that I have access to lots of mesh assets that I would like to break or run other programmatic actions on. I’m personally fine with having it be an in-editor baking process. I don’t think gamers are going to notice the individual shards of things not being 100% realistically simulated but maybe that’s just me.
I’m still just getting my feet wet with Unreal, but I think Scripted Actions look like the way to go? Will look into those at some point, unless someone has a better way they could point recommend?