diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs index 9d142e4c..faf57b54 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs @@ -22,6 +22,7 @@ public class PlayerController : Script public Transform tranform { get; set; } public Camera cam { get; set; } public CameraArm camArm { get; set; } + public Collider collider { get; set; } [NonSerialized] public PickAndThrow pat; @@ -124,6 +125,10 @@ public class PlayerController : Script if(!tranform) Debug.LogError("tranform is MISSING!"); + collider = GetComponent(); + if (!collider) + Debug.LogError("collider is MISSING!"); + stateMachine = AddScript(); Dictionary dictionary = new Dictionary(); dictionary.Add(typeof(PlayerIdleState), new PlayerIdleState(stateMachine)); @@ -520,7 +525,6 @@ public class PlayerController : Script public void Caught() { - //Debug.Log("PlayerController: Raccoon Caught"); currentState = RaccoonStates.CAUGHT; if (stateMachine && !stateMachine.IsState(typeof(PlayerCaughtState))) stateMachine.SetState(typeof(PlayerCaughtState)); @@ -543,13 +547,21 @@ public class PlayerController : Script camArm.ArmLength = pat.tpc.armLength; } } + + landedOnJumpPad = false; + jumpPadDrop = false; + rb.ClearForces(); + rb.ClearTorque(); + rb.LinearVelocity = Vector3.Zero; + rb.AngularVelocity = Vector3.Zero; } public void Reset() { if (tranform && respawnPoint) { - currentState = RaccoonStates.IDLE; + + currentState = RaccoonStates.IDLE; if (stateMachine && !stateMachine.IsState(typeof(PlayerIdleState))) stateMachine.SetState(typeof(PlayerIdleState)); diff --git a/Assets/Scripts/Gameplay/SC_ScoringZone.cs b/Assets/Scripts/Gameplay/SC_ScoringZone.cs index 7acf6948..78c10080 100644 --- a/Assets/Scripts/Gameplay/SC_ScoringZone.cs +++ b/Assets/Scripts/Gameplay/SC_ScoringZone.cs @@ -22,7 +22,11 @@ public class ScoringZone : Script { if (GameManager.Instance && info.GameObject.GetScript() && info.GameObject.IsActiveSelf && !info.GameObject.GetComponent().GetCollisionShape(0).IsTrigger ) { - GameManager.Instance.Score += info.GameObject.GetScript().Score * GameManager.Instance.currMultiplierCombo; + if (GameManager.Instance.currMultiplierCombo > 1) + GameManager.Instance.Score += info.GameObject.GetScript().Score * GameManager.Instance.currMultiplierCombo; + else + GameManager.Instance.Score += info.GameObject.GetScript().Score; + GameManager.Instance.ItemScored(); particle.EmissionCount = startingParticleCount * GameManager.Instance.currMultiplierCombo; particle.Emit();