Cant add distance,Prismatic joint of farseer in truesyns.

I have been used farseer physic, But when I move to truesyns, I try add distance or prismatic joint but object doesn't efffect.



This my code:

public override void OnSyncedStart ()
{
base.OnSyncedStart ();
tsRigidBody2D.useGravity = true;
World world = (World)Physics2DWorldManager.instance.GetWorld();
if(refAnchorObj != null){

TSTransform2D anchorTrans = refAnchorObj.GetComponent ();
Body a = (Body)anchorTrans.tsCollider.Body;
Body b = (Body)tsRigidBody2D.tsCollider.Body;
PrismaticJoint joint = JointFactory.CreatePrismaticJoint (world, a, b,TSVector2.zero,TSVector2.up);
joint.LimitEnabled = true;
joint.SetLimits (-10, 10);
joint.CollideConnected = false;
joint.MotorSpeed = 1000;
joint.MotorEnabled = true;
joint.MaxMotorForce = 1000;
joint.Enabled = true;
}
else{
Debug.Log ("refAnchorObj null;");
}
}
public override void OnSyncedUpdate ()
{
base.OnSyncedUpdate ();
World world = (World)Physics2DWorldManager.instance.GetWorld();
Debug.Log ("world count: "+world.JointList.Count);
}

Comments

  • Hi @ttcong194, we don't support all features of the physics engine, because we need to take care of determinism. In the matter of joints we only implement a version of hingejoint (TSHingeJoint).
Sign In or Register to comment.