Ok I have impulse button for my bike which should rotate the bike around it’s center (like elasto mania), but when i do so when facing left side of screen the wheels rotate in opposite direction than body. When facing right side it is just fine.
EDIT: I noticed that the wheel rotates clockwise when i add torque and it’s facing left, but still moves to the left like it’s rotating counter-clockwise… Odd.
Latest EDIT: I still need some help… It seems like the model is wrong way but nothing helps
Here’s the rotating code that changes facing:
function getAround(){
var joints = GetComponents(SpringJoint2D);
for(var joint: SpringJoint2D in joints){
var temp = joint.anchor;
joint.anchor = Vector2(-temp.x,temp.y);
}
//var temp = object;
//var temp2 = object2;
//object = temp2;
//object2 = temp;
runko.rigidbody2D.isKinematic = true;
object.rigidbody2D.isKinematic = true;
object2.rigidbody2D.isKinematic = true;
runko.transform.Rotate(Vector3(0,1,0), 180);
runko.rigidbody2D.isKinematic = false;
object.rigidbody2D.isKinematic = false;
object2.rigidbody2D.isKinematic = false;
facing = vaihto(facing);
}
And here demonstration of the problem: