From c3bfa41864a588b99e51898b2e7d6ee1a5f35f7c Mon Sep 17 00:00:00 2001 From: tylerweston Date: Mon, 1 Feb 2021 18:22:30 -0500 Subject: [PATCH] crates are kinematic during push --- .../ThirdPersonCharacter/Scripts/ThirdPersonUserControl.cs | 1 + Assets/Scripts/BoxPush.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Assets/Characters/ThirdPersonCharacter/Scripts/ThirdPersonUserControl.cs b/Assets/Characters/ThirdPersonCharacter/Scripts/ThirdPersonUserControl.cs index 44819bc..fa7beb9 100644 --- a/Assets/Characters/ThirdPersonCharacter/Scripts/ThirdPersonUserControl.cs +++ b/Assets/Characters/ThirdPersonCharacter/Scripts/ThirdPersonUserControl.cs @@ -581,6 +581,7 @@ private void FixedUpdate() isInMovingAnimation = true; // play the pushing sound m_Character.grabbedBox.GetComponent().PlaySound(); + m_Character.grabbedBox.GetComponent().isKinematic = true; } } else diff --git a/Assets/Scripts/BoxPush.cs b/Assets/Scripts/BoxPush.cs index 17bcf47..397494b 100644 --- a/Assets/Scripts/BoxPush.cs +++ b/Assets/Scripts/BoxPush.cs @@ -105,6 +105,7 @@ void DropCrate() m_Character.grabbedBox = null; m_Character.lockOnZAxis = false; m_Character.lockOnXAxis = false; + this.GetComponent().isKinematic = false; secondsOfPushing = 0.0f; playerIsPushing = false; playerGrabbing = false;