27-04-2025, 07:43 PM
Code:
public void OnRopeContactEnter(ObiSolver solver, Oni.Contact contact)
{
var world = ObiColliderWorld.GetInstance();
var col = world.colliderHandles[contact.bodyB].owner;
if (col != null && col.GetComponent<Item>() != null && !col.GetComponent<Item>().ColliderTriggerControl())
{
if (!GameManager.instance.usedItems.Contains(col.GetComponent<Item>()))
{
GameManager.instance.UsedItemsAdd(col.GetComponent<Item>());
Debug.Log("Contact: " + col.name);
int particleIndex = contact.bodyA;
Vector2 contactPoint = solver.positions[particleIndex] + contact.normal * contact.distance;
}
}
}
How do I find the value of "normalizedCoord"?
Can I find a value that corresponds to the "M" value in the Obi Rope Attach code?
I need the collision value of the item with the rope (e.g. 0.658f) to be able to launch the object from that point.