Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pin constraint attached to hanging platform has strange behavior
#3
Setting phases and using the inverse transformed position from the collider solved the issue.


Code:
batch.AddConstraint(0, m_ObiCollider, m_ObiCollider.transform.InverseTransformPoint(m_HelicopterAnchorPoints[i].position), Quaternion.identity);
batch.AddConstraint(blueprint.activeParticleCount - 1, Pallet.GetObiCollider(), Pallet.GetObiCollider().transform.InverseTransformPoint(anchorPoint.position), Quaternion.identity);


HOWEVER, it still freezes the rotation of both the platform and the helicopter. Why is this?

Nevermind. Solved using the regular ObiParticleAttachment components.

Code:
// Get components
ObiParticleAttachment mainRopeAttachment = m_Ropes[i].gameObject.AddComponent<ObiParticleAttachment>();ObiParticleAttachment palletAttachment = m_Ropes[i].gameObject.AddComponent<ObiParticleAttachment>();

// Find the particle groups
var groups = m_Ropes[i].blueprint.groups;

// Attach sub rope to main rope
mainRopeAttachment.target = m_ObiCollider.transform;
mainRopeAttachment.particleGroup = groups[0];
mainRopeAttachment.attachmentType = ObiParticleAttachment.AttachmentType.Static;

// Attach the rope to the pallet
palletAttachment.target = m_Pallet;
palletAttachment.particleGroup = groups[groups.Count - 1];
palletAttachment.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;
Reply


Messages In This Thread
RE: Pin constraint attached to hanging platform has strange behavior - by mr-matt - 14-07-2020, 12:10 AM