From a9ed3bdc85689560f1158264d6ce4c280425791e Mon Sep 17 00:00:00 2001 From: haitem Date: Sun, 30 Jan 2022 12:19:35 +0100 Subject: [PATCH] Push fix of script --- Assets/Scripts/PlayerController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index fe4f602..95a44c9 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -193,7 +193,7 @@ public class PlayerController : MonoBehaviour switch (platform.type) { case PlatformManager.PlatformType.Push: - rb.AddForce(-(pushObject.transform.position - transform.position) * step, ForceMode.Force); + rb.AddForce(-(other.transform.position - transform.position) * step, ForceMode.Force); break; case PlatformManager.PlatformType.Pull: rb.AddForce((other.transform.position - transform.position) * step, ForceMode.Force);