fix: no thrust when turning, boost thrusts also, clear character colors

This commit is contained in:
Jakob Feldmann 2024-02-20 11:53:00 +01:00
parent 26df04dbf0
commit 3be9ecd155
2 changed files with 5 additions and 5 deletions

View File

@ -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: []

View File

@ -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;