Get object to rotate freely influenced by gravity
Hello, I am currently making a fairground ride and I want the seats where people sit to spin on a hinge attached to the spinning arm but I want it to be influenced by gravity so how it would rotate in real life. I does anyone know how I can go about this and if its possible using a hinge? The problem I have is that the Axis changes because the main arm is rotating on one axis, then the bit that spins the seats on another axis, then I want the seats to spin freely.
Here is a video of what I am after: https://www.youtube.com/watch?v=aH4-IHRx5Mw
Thanks, if anyone could help that would be amazing!
Like I said here: http://answers.unity3d.com/questions/1256415/rotation-that-keeps-upright.html#comment-1256800 you need to rotate the object in local space if it is a child.
There is more than one way to achieve what youre after.
You could have the object not be a child at all and just update its position.
you could have the object rotate towards Vector3.up as described here: http://answers.unity3d.com/questions/587020/how-to-make-plane-rotate-towards-player-and-keep-u.html
you could attach a hinge joint : https://docs.unity3d.com/ScriptReference/HingeJoint.html
The best way to get help is to attempt it and show your code. Noone wants to write scripts for you and if they do, they are being extremely nice.
@b1gryn4n
void Update () { transform.RotateAround(transform.position, transform.right, Time.deltaTime * 30f);
}
}
How would I modify this to rotate right until it fully upright?
Your answer
Follow this Question
Related Questions
Door hinge joints 0 Answers
Local Hinge Joint Angle? 1 Answer
Player rotates spastically on all axes when camera is turned 0 Answers
How can I calculate RPM to rotate a monowheel based on Rigidbody velocity? 0 Answers
Move Ragdoll without gravity 1 Answer