Update:
I managed to register some collisions, though most still don't. I made no changes since the last post so I'm unsure what the issue is or why it briefly stopped. However, even when the collisions were registered and I saw the "Hand Collision" message, newBatch returned a null value so something in the creation of the constraints batch seems not to be working. Any thoughts?
Line 67 is this:
pinConstraints.AddBatch(newBatch);
Edit: sorry I literally pasted the wrong line by accident!
Further update:
It gets stranger... It seems that the collisions only register when the player hand collides with both the hook and the rope simultaneously.
I've implemented this change though it shouldn't set canGrab to false unless the contactCollider is the hand collider, I briefly added an update loop that debugged the value of canGrab and it never seems to change due to the error in adding the newBatch value to the solver if the grab even gets that far
I managed to register some collisions, though most still don't. I made no changes since the last post so I'm unsure what the issue is or why it briefly stopped. However, even when the collisions were registered and I saw the "Hand Collision" message, newBatch returned a null value so something in the creation of the constraints batch seems not to be working. Any thoughts?
Line 67 is this:
pinConstraints.AddBatch(newBatch);
Edit: sorry I literally pasted the wrong line by accident!
Further update:
It gets stranger... It seems that the collisions only register when the player hand collides with both the hook and the rope simultaneously.
(04-02-2021, 12:09 PM)josemendez Wrote: I don't see anything wrong in your screenshots, and the code looks ok to me too.
However, if you're relying on the Debug.Log() in your code to see if there's contacts being reported between your hand and the rope, keep in mind that the Debug.Log() will only be called if canGrab is true. In case your contactCollider is any collider other than the hand collider, and it happens to appear in the contact list before contacts against the hand, canGrab will be set to false and the Debug.Log() for the hand will never be hit despite contacts being there.
This is the only thing that comes to mind that could cause this, since the contact list passed to the collision event is the exact same one used in the simulation. If the hand is able to push the rope around, contacts against it *must* be in the list.
Try testing for canGrab in a separate, nested if() and place the Debug.Log right before it. See if it reports contacts against the hand then.
I've implemented this change though it shouldn't set canGrab to false unless the contactCollider is the hand collider, I briefly added an update loop that debugged the value of canGrab and it never seems to change due to the error in adding the newBatch value to the solver if the grab even gets that far