Double inverse rotation

Hi, i’m working on a project that simulate a ride fairground.

Here is the reel ride in action:

Here is mine virtual ride.

I have attach this script on each arm, to make a good inverse rotation but it failed.

function Update() {
if (Input.GetKey(“o”)) {
hingeJoint.useMotor = true;
} else {
hingeJoint.useMotor = false;
}
}

In fact, at the beginning, when i press the “O” key, the two arms ’ arm1 arm2" rotate around their axis.

And after, the rotation is not synchronized, can you help me to find a good script that attach the two arms with an inverse rotation and synchronized movement.

Please, be sure your help is welcome…

Thanks a lot, FrenchySim.

Don’t you simply have an object that has two sub objects, which are the arms. You then have a script to the parent object (root) that has 2 references “public transform mObjectA; public transform mObjectB” which you then point the two arms at.

You then, in the root script, apply same rotation to both of those transform, but one with -ve numbers, and you’re done?

If you want to let physics do it all for you use hinge joint and then you can apply force to your objects to make them move.

Hi, yes i have apply motor forces whith hinge joint on Y axis on both arms. but i’m not satisfy. it still exist a differential phase angle. It’s not sync.
I have two object one called “FWD ARM” and the other one called “REAR ARM”. Each of them have a script that you can see on the first post of this thread.
But with this script, each arm is independent. That’s why at some point the arms are unsync. I need, with your help to find a script which is the best to sync my two arms…

Best regards.

Hi guys, i need your help once again. PompeyPaul, i think that you say can be good. But can you write me the code please…
Also, i used hinge joint on both arms. How can i set my code to make it brake stronger? Can i use collider.brakeTorque or other script.

Here is the step by step of my simulation.

1°) I push the “B” key, it release the brake apply on both arms.
2°) I push the “O” key, both arm move around the “Y Axis”.
3°) At some point ( for example when the passengers are upside down ) if i want to brake both arm stronger, i push the “B” key to brake them and dont move.
4°) I push “B” to release the brake and the arms moves around the “Y Axis” with the gravity.
5°) etc…

Thanks to help me guys, Best regards, FrenchySim