From 3be9ecd1552b518bac3f4551cb41482581630e7f Mon Sep 17 00:00:00 2001 From: Jakob Feldmann Date: Tue, 20 Feb 2024 11:53:00 +0100 Subject: [PATCH] fix: no thrust when turning, boost thrusts also, clear character colors --- Assets/Scenes/BattleField.unity | 4 ++-- Assets/Scripts/PlayerController.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Scenes/BattleField.unity b/Assets/Scenes/BattleField.unity index 0ba56bd..60b7518 100644 --- a/Assets/Scenes/BattleField.unity +++ b/Assets/Scenes/BattleField.unity @@ -1227,7 +1227,7 @@ PrefabInstance: - target: {fileID: 6404588952760066782, guid: 46f84e56340e83e4ba7c6abbccd2ae3f, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: -876546973899608171, guid: 7bbccc5c40aae3e478e0205f25cd16ef, type: 3} + objectReference: {fileID: -6478536213147159724, guid: 0314dc2e0a09e6b46809ba485ec101ed, type: 3} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -1295,7 +1295,7 @@ PrefabInstance: - target: {fileID: 5411380178868568951, guid: 65cd4fa5e050652409dd9b062365c7e8, type: 3} propertyPath: m_Materials.Array.data[0] value: - objectReference: {fileID: 15303, guid: 0000000000000000f000000000000000, type: 0} + objectReference: {fileID: 4874126678125670354, guid: 61dc60d6e44cd9f46bc21aa06f06f92b, type: 3} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 64a7d51..a756c4d 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -1,5 +1,6 @@ using System; using Unity.Mathematics; +using UnityEditor.ShaderGraph.Internal; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.SceneManagement; @@ -115,9 +116,8 @@ public class PlayerController : MonoBehaviour float stunFactor = isCriticalTackle ? stunLooseControlFactor : 1f; - Vector3 acceleration = thrustAcceleration * math.max(currentThrustInput - math.abs(currentSteerInput), math.abs(currentSteerInput)) - * Time.deltaTime * Vector3.up * stunFactor; - + currentThrustInput = IsBoosting() ? 1f : currentThrustInput; + Vector3 acceleration = thrustAcceleration * currentThrustInput * Time.deltaTime * Vector3.up * stunFactor; Vector3 currentVelocity = body.velocity;