Hello,
I’m busy working on a Simulation Game.
And whenever I let everything rotate (Including physics on the seats) using HingeJoint - Motor, it doesn’t wobble or shake whatsoever.
But seen as it is a simulation, every moving part’s speed, is controllable using Key’s.
Writing the HingeJoint Motor manually in JavaScript code, makes the moving models Shake and Wobble,
how to avoid this and why does it happen?
var pfspeed : float = 0.0;
var platform : Rigidbody;
gameObject.AddComponent("HingeJoint");
hingeJoint.anchor = Vector3 (0,0,-1);
hingeJoint.axis = Vector3.forward;
function FixedUpdate () {
rigidbody.mass = 10;
rigidbody.drag = 0;
rigidbody.angularDrag = 0.05;
hingeJoint.useMotor = true;
if (Input.GetKey("q")) {
pfspeed += 0.1;
}else{
pfspeed -= 0.1;
}
if (Input.GetKey("e")) {
pfspeed -= 0.1;
}else{
pfspeed += 0.1;
}
hingeJoint.motor.force = pfspeed;
hingeJoint.motor.targetVelocity = pfspeed;
hingeJoint.motor.freeSpin = false;
pfspeed = Mathf.Clamp(pfspeed, 0.0, 75); //75 being the speed.
}
Kind Regards.