Hello! Is there a way to change Minimum mass clamp in a GeometryCollectionComponent with code?
Could you provide more context please?
When you make a geometry collection you have all these variables like damage threshold, mass, etc. and you can change them easy but when i try to find something related to Minimum Mass clamp i dont find anything that can access that variable
Looking at the source code that is a member of UGeometryCollection not UGeometryCollectionComponent. So you would first need to get the UGeometryCollection the component stores. Based on the source code that would presumably be
GeoCollectionComp->RestCollision->MinimumMassClamp
Now it should work but it says “expression must be a modifiable lvalue” i guess because RestCollision is const. What can i do?
Ah yes, I didn’t notice the const
. It looks like you need to use EditRestCollection
and modify it through that, it looks to be an RAII wrapper so its destructor would do the work, e.g.
{ // create new scope to edit
auto EditCollection = GeomCollectiobComponent->EditRestCollection()
EditCollection.GetRestCollection()->MinimumMassClamp = ...;
} // EditCollection destructor gets called.
It works now and i can change the MinimumMassClamp but it changes the value for all the GeomCollectionComponent to the same value. Is it possible to have 2 GeomCollectionComponent but with different values?
Honestly I don’t know, I’ve never used it before.
Either way ty so much for the help
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.