- Home /
lifting physic objects with dynamic weight objects on it
Hi.
I want to create a lift for my project which should be affected by a dynamic number of weight objects on it.
The lift should get a force which moves it up to a specified height which depends on the summed up weight of the weight objects and then stop.
I.e.: There are three objects on the lift with the same weight. The lift moves up to the third floor (... and there the weight objects are unloaded). If there are ten objects on the lift it will move to the tenth floor (... and unloads).
Now here are my questions:
1.) How could I detect how much weight is on the lift? When there are three weight objects on the lift, is there any force applied on the lift too? Do I have to join the weight objects to the lift for applying the force?
2.) How could I stop the lift when reaching the correct height without having it to fall down?
3.) I think I have to use rigidbodies and physics for my project, but maybe someone has an much easier solution for my project? :)
Thx for help!
any chance you could draw a quick diagram of what you're trying to do? And any other variations on it that you might have for the future? That way whatever crap "solution" I dream up can have the next options available for extension
Answer by pahe · Mar 15, 2011 at 03:32 PM
Thx for the suggestions.
I found a suitable solution with the configurable joint:
http://unity3d.com/support/documentation/Components/class-ConfigurableJoint.html
Its a bit trail & error but fits my requirements best :)
regards
Answer by efge · Mar 15, 2011 at 11:04 AM
If you want to use objects with Rigidbodies (maybe because you need them before and after the lift sequence), I would suggest switching physics off:
Let the player put the objects on the lift.
Before the lift sequence starts disable physics for all objects by using rigidbody.isKinematic = true;
Count the weight of the objects by using Rigidbody.mass, (sum = floor)
Play your lift sequence or animation.
At last enable physics for all objects by using rigidbody.isKinematic = false;
Your answer
![](https://koobas.hobune.stream/wayback/20220613112916im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make Character Joint rotate towards a rest position? 0 Answers
Connecting SpringJoint2D to Rotating Rigidbody2D With Correct Anchor 0 Answers
consecutive angularxdrive.positionspring.equals() not working 0 Answers
Bend object with physics interaction 0 Answers
Rigidbody hover, bodies connected with joints should hover together. 0 Answers