Crane minor changes

This commit is contained in:
Daniel Tyomin
2024-08-19 20:31:53 +02:00
parent 11ebf74721
commit 19f2d59054
2 changed files with 171 additions and 4 deletions

View File

@@ -29,6 +29,11 @@ public class CranePickDrop : MonoBehaviour
{
var otherRb = sender.triggeredCollider.attachedRigidbody;
if (!otherRb.GetComponent<Product>())
{
return;
}
if (otherRb && otherRb.isKinematic == false && state == State.Idle)
{
handlingBody = otherRb;
@@ -58,8 +63,11 @@ public class CranePickDrop : MonoBehaviour
state = State.Idle;
return;
}
magnet.strength = magnetStrength;
if (magnet.IsCloseTo(handlingBody, 5f))
{
magnet.strength = magnetStrength;
}
if (magnet.IsCloseTo(handlingBody, 2f))
{