Hey guys,
I’m working on a project where a number of objects have a weight value that I define, as well as a value that indicates the maximum weight the object can sustain. Using the physics engine, I’m trying to make a system where stacked objects impart their weight values onto the objects below them and if the objects below exceed their maximum weight values, the objects break. Additionally, if an object is placed on top of a stack of objects, it applies its weight to the one below it, which in turn applies the combined weight to the one below it, and so on.
Additionally, I’m trying to support the ability to distribute weight amongst more than one object below. For example, if I place an object on top of two other objects, it imparts half of its weight to each of the two objects rather than all of it to one.
As you might guess, I’m having a lot of trouble getting this to work correctly given the available OnCollision functions and whatnot. I’m wondering if anyone has any thoughts on how they’d implement such a system, or whether the physics system has some built-in elements I can be using for this. This is an iphone game, so I’m also trying to decide what is most performance-savvy.
I feel pretty stuck on this, so any thoughts or suggestions would be extremely welcomed and appreciated.
Thanks