Movements of Engine 4 cylinders in line

Hello,

Since one week, I try to replicate the movements of connecting rods and pistons on a crankshaft.

Unfortunately, I can not move the connecting rods on two independent axes of rotation (the axis side piston and crankshaft axis side).

In Unity, the crankshaft is the parent of the connecting rods and pistons, connecting rods children.

Here is my current code that runs the vibrequin while the pistons and connecting rods follow the movement of a vertically only.

//             TRANSLATOR French/English from Engine 4 cylinders in line parts

// 		Vilebrequin = crankshaft
// 		Bielle = connecting rod
//		piston = piston

var Vilebrequin:GameObject;
var Bielle1:GameObject;
var piston1:GameObject;
var Bielle2:GameObject;
var piston2:GameObject;
var Bielle3:GameObject;
var piston3:GameObject;
var Bielle4:GameObject;
var piston4:GameObject;
var vitesse=1;

function Update () {

print (transform.eulerAngles.z); 

Vilebrequin.transform.Rotate (0,0,vitesse);

Bielle1.transform.rotation = Quaternion.AngleAxis(0, Vector3.up);
Bielle2.transform.rotation = Quaternion.AngleAxis(0, Vector3.up);
Bielle3.transform.rotation = Quaternion.AngleAxis(0, Vector3.up);
Bielle4.transform.rotation = Quaternion.AngleAxis(0, Vector3.up);

}

On this link, the current animation results: http://www.vuedehaut.fr/engine/WebPlayer.html

If you have an idea of change, I’m very interested …

Philippe

Hmmm… have you tried using a hinge joint on the connecting rod and a slider (complex) joint on the piston and not having them parented to the crank?

Hi BigMisterB,
No, I did not test this. I think my problem is very complicated for everyone! Even here, no one can answer …
I still continued to show and I warn you when I made progress.
Philippe