Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  how can i creat a chain at run time
#1
hi, I just buy the ObiRope, it's so cool. i'm useing your demo GrappingHook, i use it to my little demo. please see the video.



i can attch rope from player to a object, but the object is so wired, the physic seems not right when is attched to the rope. and you can see the second
time in my video the chain and the object is all good.but the second time i don't use run time generate。

and how can i change the rope to a chain?

i think is this code?

Code:
// 設置兩點的交互,rope對物體的影響在這裡設置:
        var pinConstraints = blueprint.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
        //var pinConstraints = blueprint.GetConstraintsByType(Oni.ConstraintType.Chain) as ObiConstraints<ObiPinConstraintsBatch>;
        var batch = pinConstraints.batches[0];
        batch.AddConstraint(0, character, transform.localPosition, Quaternion.identity);
        batch.AddConstraint(blueprint.activeParticleCount - 1, hookAttachment.collider.GetComponent<ObiColliderBase>(),
                                                          hookAttachment.collider.transform.InverseTransformPoint(hookAttachment.point), Quaternion.identity);
        batch.activeConstraintCount = 2;

sorry for my english, thanks.
Reply


Messages In This Thread
how can i creat a chain at run time - by huahuapro - 29-07-2020, 02:03 AM