diff --git a/Assets/Animations/Jumping Up.fbx.meta b/Assets/Animations/Jumping Up.fbx.meta index 5b38264d36d2695cdf213773a8d8067453e870ea..6fc3e8add255cf4c5aba16de1a000d37432db77e 100644 --- a/Assets/Animations/Jumping Up.fbx.meta +++ b/Assets/Animations/Jumping Up.fbx.meta @@ -46,7 +46,7 @@ ModelImporter: cycleOffset: 0 loop: 0 hasAdditiveReferencePose: 0 - loopTime: 0 + loopTime: 1 loopBlend: 0 loopBlendOrientation: 0 loopBlendPositionY: 0 diff --git a/Assets/Animations/Walk&Run Movement.controller b/Assets/Animations/Walk&Run Movement.controller index c206d63a9ba096480798867b040d4e955ce00370..681fd14e15c35f71dd80a878e1234c21106934c0 100644 --- a/Assets/Animations/Walk&Run Movement.controller +++ b/Assets/Animations/Walk&Run Movement.controller @@ -174,25 +174,31 @@ AnimatorController: m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: Jump m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: AnimSpeed m_Type: 1 m_DefaultFloat: 1 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} - m_Name: PickUp m_Type: 4 m_DefaultFloat: 0 m_DefaultInt: 0 m_DefaultBool: 0 - m_Controller: {fileID: 9100000} + m_Controller: {fileID: 0} + - m_Name: Motion + m_Type: 1 + m_DefaultFloat: 2 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} m_AnimatorLayers: - serializedVersion: 5 m_Name: Base Layer @@ -360,8 +366,8 @@ AnimatorState: type: 3} m_Tag: m_SpeedParameter: AnimSpeed - m_MirrorParameter: - m_CycleOffsetParameter: Speed + m_MirrorParameter: Jump + m_CycleOffsetParameter: Motion m_TimeParameter: Speed --- !u!1101 &6964413758257151049 AnimatorStateTransition: diff --git a/Assets/Scenes/Game/SampleScene.unity b/Assets/Scenes/Game/SampleScene.unity index a9f8e466fa7155e7231f1debb2e3f0463d6de7a0..644262613c5eb85a9f2e8c5f1ddbcb5d0c5f7826 100644 --- a/Assets/Scenes/Game/SampleScene.unity +++ b/Assets/Scenes/Game/SampleScene.unity @@ -9599,7 +9599,7 @@ PrefabInstance: - target: {fileID: 1331997591070191852, guid: 2342577add2bab844a55e25cc4fea601, type: 3} propertyPath: pushPower - value: 2 + value: 1 objectReference: {fileID: 0} - target: {fileID: 1331997591070191852, guid: 2342577add2bab844a55e25cc4fea601, type: 3} diff --git a/Assets/Scripts/PlayerPickUp.cs b/Assets/Scripts/PlayerPickUp.cs index ac83a2c9a54ff42204ff882eaef91dbaed772bce..3a398e44238c8c66f560c93deb081099e6777dde 100644 --- a/Assets/Scripts/PlayerPickUp.cs +++ b/Assets/Scripts/PlayerPickUp.cs @@ -122,6 +122,7 @@ public class PlayerPickUp : MonoBehaviour if (interactiveobjects.Contains(other.gameObject)) { interactiveobjects.Remove(other.gameObject); + anim.SetBool("PickUp", false); } } diff --git a/Assets/Scripts/SCTPSController.cs b/Assets/Scripts/SCTPSController.cs index 858cafb73cc0bb9c215514c0b90c180f7a251db9..084cd7b7fbee160ee5055893f2f4f42167cfee10 100644 --- a/Assets/Scripts/SCTPSController.cs +++ b/Assets/Scripts/SCTPSController.cs @@ -64,6 +64,7 @@ public class SCTPSController : MonoBehaviour public bool running; public float jumpLength; + public bool gliding; void Start() { @@ -195,10 +196,14 @@ public class SCTPSController : MonoBehaviour onGround = false; } - if (Input.GetButton("Jump")) + if (!gliding && Input.GetButton("Jump")) { jumpLength += 1f; } + else if (gliding == true) + { + jumpLength = 0; + } if (jumpLength > 0) { @@ -220,18 +225,21 @@ public class SCTPSController : MonoBehaviour if (!characterController.isGrounded && Input.GetKey(KeyCode.LeftShift)) { + gliding = true; + + Glide(); + gravity = 10f; glidesDone++; moveDirection.x = Input.GetAxis("Horizontal") * glideSpeed; moveDirection.z = Input.GetAxis("Vertical") * glideSpeed; moveDirection = transform.TransformDirection(moveDirection); - - Glide(); } else { gravity = 30f; + gliding = false; } if (glidesDone >= 10)