From bc2832095e91410f0425774361c1f6a7505f4066 Mon Sep 17 00:00:00 2001 From: haitem Date: Sat, 29 Jan 2022 21:29:54 +0100 Subject: [PATCH 1/3] Add player side modifaier --- 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 259e493..68c2d49 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -82,7 +82,7 @@ public class PlayerController : MonoBehaviour } float curSpeedX = canMove ? (currentSpeed + modifier) : 0; - float curSpeedY = canMove ? speed * Input.GetAxis("Horizontal") : 0; + float curSpeedY = canMove ? (speed + modifier) * Input.GetAxis("Horizontal") : 0; moveDirection = (platformForward * curSpeedX * Time.deltaTime) + (transform.right * curSpeedY * Time.deltaTime); From 2768930e01ebb3d32508857f2479ef37dc1c5ae7 Mon Sep 17 00:00:00 2001 From: haitem Date: Sat, 29 Jan 2022 21:36:42 +0100 Subject: [PATCH 2/3] Repair side move --- 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 d1c78dc..63763fe 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -82,7 +82,7 @@ public class PlayerController : MonoBehaviour } float curSpeedX = canMove ? (currentSpeed + modifier) : 0; - float curSpeedY = canMove ? (speed + modifier) * Input.GetAxis("Horizontal") : 0; + float curSpeedY = canMove ? (currentSpeed + modifier) * Input.GetAxis("Horizontal") : 0; moveDirection = (platformForward * curSpeedX * Time.deltaTime) + (transform.right * curSpeedY * Time.deltaTime); From 7ac04aa6899f5d7e82933a2a50a4c7c6760de694 Mon Sep 17 00:00:00 2001 From: haitem Date: Sat, 29 Jan 2022 21:45:56 +0100 Subject: [PATCH 3/3] Repair prefabs and edit side speed --- Assets/Prefabs/platforms/Platform_Blue.prefab | 2 +- Assets/Prefabs/platforms/Platform_Red.prefab | 2 +- Assets/Scripts/PlayerController.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Prefabs/platforms/Platform_Blue.prefab b/Assets/Prefabs/platforms/Platform_Blue.prefab index 6d95cde..a4be2c1 100644 --- a/Assets/Prefabs/platforms/Platform_Blue.prefab +++ b/Assets/Prefabs/platforms/Platform_Blue.prefab @@ -199,7 +199,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: type: 2 - speed: 10 + speed: 20 --- !u!65 &8238111678033492397 BoxCollider: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/platforms/Platform_Red.prefab b/Assets/Prefabs/platforms/Platform_Red.prefab index 754bd50..45c2ff6 100644 --- a/Assets/Prefabs/platforms/Platform_Red.prefab +++ b/Assets/Prefabs/platforms/Platform_Red.prefab @@ -199,7 +199,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: type: 1 - speed: 10 + speed: 5 --- !u!65 &5316890779910729157 BoxCollider: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 63763fe..9e1cf87 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -82,7 +82,7 @@ public class PlayerController : MonoBehaviour } float curSpeedX = canMove ? (currentSpeed + modifier) : 0; - float curSpeedY = canMove ? (currentSpeed + modifier) * Input.GetAxis("Horizontal") : 0; + float curSpeedY = canMove ? (currentSpeed + 3.5f + modifier) * Input.GetAxis("Horizontal") : 0; moveDirection = (platformForward * curSpeedX * Time.deltaTime) + (transform.right * curSpeedY * Time.deltaTime);