The specific example I have in mind is the classic ‘two platforms connected via a pulley’ system. You pile weights on one; it goes down; the other goes up. Simulating this via a literal series of rope joints is massive overkill, not to mention glitch-prone.
What I’m looking for is either a joint type that transforms and combines forces between objects (so that the forces acting down on one are applied up/sideways/some other direction on the other, and vice-versa), or some way of manually obtaining the summed forces operating on two objects and transforming/applying them myself at a point in the update that results in stable behaviour.
I’m working in 2D, by the way, if that makes a difference.
Every time a platform recieves a force (In Y axis, I guess) it applies the same impulse but negative to the other platform, so if platform 1 recieves an impulse of 10, the other will recieve an impulse of -10, making it go in the oposite direction. And, If platform 2 receives an impulse of -25, platform 1 will recieve an impulse of 25, again, in the opposite direction (–25 = 25). It will be interesting to have a joint that does that job, maby the configurable joint can do it. Hope this helped
What if you place a generously-sized trigger on top of a platform, and have a script that adds up the mass of all resting rigidbodies within the trigger volume? Then compare that mass against a similarly calculated mass on the second platform and move them up/down accordingly.
It sounds cheaty, but if your objects don’t have problematic shapes that can come in contact with other things while being on the platform (like long planks), and you don’t have too many of them, then it could work. The “resting” part might be a bit problematic though - you won’t be able to use isSleeping(since bodies will wake up every time their underlying platform moves), but you could play with calculating relative velocities or something.
Right now it’s a proof-of-concept that links two platforms such that forces and motion applied to one are inverted and combined with the other. It’s stable (if you put the same amount of weight on both platforms they balance), and it reacts correctly to impulse (if you put a 1kg weight on one side and drop a 1kg weight on the other, the jerk is transferred. Stacking up objects on top of a platform (2x1kg on one side, 1x2kg on the other) also works.
I’m going to be turning this into a proper general-purpose linkage solution, supporting arbitrary force transformation and scaling between movement and rotation of any number of objects, and releasing it on the Asset store.
Further update: “Linkage” will hopefully soon be available on the Asset Store. It’s a fully generalised implementation where you can assemble any number of ‘mechanisms’, each composed of any number of rigid bodies. Here’s a quick demo video of it in action:
Further update: “Linkage” will not be available on the Asset Store, because Unity want me to jump through so many ridiculous hoops that it’s just not worth the effort. Sorry.
Not at all, I can “hear” your frustration. I’m just not sure if it’s you having a bad day and venting (oh how we all do that here and there) and/or if there’s a genuine horrible blocker. You seemed to have spent a lot of time on your project so I was kind of shocked you should then just drop it because of some issue.
Hi - I’ve updated the meta-data and taken another wild programmer swing at the art, and I’ll be removing the wonky license file that I thought I needed but definitely didn’t, but if the offer still stands to have someone from the Asset Store team explain what’s wrong with my website, that would be fantastic.
Note that they’ve all landed and were released in previous versions: 2022.1.0a15 (released, now 2022.1.0b2), 2021.2.3f1 (released, now 2021.2.6f1) & 2020.3.23f1 (released, now 2020.3.24f1 LTS)
It takes a little while sometimes for your case report to update to show this as it gets consolidated in a QA gather-up and reverification. They do appear in all the release logs with your case number of 1376170 though.