Running in unity 5 this codes not working, any ideas?
var legEndPos:Vector2;
var legRot = legLeft.transform.rotation.eulerAngles.z;
legEndPos.x = legLeft.transform.position.x + (Mathf.Cos(((legRot-90))*(Mathf.PI/180.0))*(0.12));
legEndPos.y = legLeft.transform.position.y + (Mathf.Sin(((legRot-90))*(Mathf.PI/180.0))*(0.12));
legLeftHinge = legLeft.AddComponent(HingeJoint2D);
legLeftHinge.anchor.x = 0;
legLeftHinge.anchor.y = -0.12;
legLeftHinge.connectedAnchor = legEndPos;
↧