From 057ed2e09e6bd829f86d131b4082f1315953dec9 Mon Sep 17 00:00:00 2001 From: hzmt Date: Sat, 31 Jan 2026 23:07:56 -0600 Subject: [PATCH] Trying to fix the issue where players get pinched through the floor --- Assets/Scripts/PlayerPickupController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Assets/Scripts/PlayerPickupController.cs b/Assets/Scripts/PlayerPickupController.cs index 6a869ed..889ab14 100644 --- a/Assets/Scripts/PlayerPickupController.cs +++ b/Assets/Scripts/PlayerPickupController.cs @@ -17,6 +17,7 @@ public class PlayerPickupController : MonoBehaviour [SerializeField] private float throwChargeTime = 0.75f; [SerializeField] private float throwUpwardForce = 0f; [SerializeField] private float throwTriggerThreshold = 0.6f; + [SerializeField] private float dropClearance = 0.2f; [Header("Setup")] public Transform holdPoint; // Empty GameObject above head @@ -165,6 +166,11 @@ public class PlayerPickupController : MonoBehaviour { heldPickup.enabled = false; } + if (heldObject.TryGetComponent(out var heldBody)) + { + heldBody.linearVelocity = Vector2.zero; + heldBody.angularVelocity = 0f; + } } if (col != null) col.enabled = false; @@ -214,6 +220,7 @@ public class PlayerPickupController : MonoBehaviour throwBody.linearVelocity = new Vector2(direction * throwSpeed, 0f); throwBody.angularVelocity = 0f; } + heldObject.transform.position += Vector3.up * dropClearance; Collider2D col = heldObject.GetComponent(); if (col != null) col.enabled = true;