I am currently working on a 2d platformer, and there are some objects the player will be able to push and/or carry. I want to create an elevator with two platforms, where the player can place blocks or himself and use the weight difference to move himself (or other objects) up or down. I can easily make the platforms move, but how do I properly weigh the blocks? And, also, how do i handle the object shaking when the platforms move?
Things I already tried:
- Platform’s rigidbody set to dynamic, bound to an anchor gameobject through joint, checking joint “tension”.
- Registering object’s mass when entering collision with the platform (does not work for stacks of boxes).
- Getting the impulse generated by each vertex of the collision, extracting Y component, adding them and using it as a parameter to decide which platform goes up and which goes down (current, problems with impulse variation when platforms move, i.e. when platform goes up, impulse from collision increases, since the platform is moving towards the object as well).
I’m currently moving the platforms using Rigidbody2D.MoveObject() method, and scripts in C#. So, any ideas?