diff --git a/Assets/Models/PlainsTerrain1.asset b/Assets/Models/PlainsTerrain1.asset index d835653..def9b5f 100644 Binary files a/Assets/Models/PlainsTerrain1.asset and b/Assets/Models/PlainsTerrain1.asset differ diff --git a/Assets/Models/PlainsTerrain2.asset b/Assets/Models/PlainsTerrain2.asset index 4a8212e..9d576ca 100644 Binary files a/Assets/Models/PlainsTerrain2.asset and b/Assets/Models/PlainsTerrain2.asset differ diff --git a/Assets/Models/Valley.asset b/Assets/Models/Valley.asset index 47a9d3e..63394d6 100644 Binary files a/Assets/Models/Valley.asset and b/Assets/Models/Valley.asset differ diff --git a/Assets/Scenes/Game-Mountain.unity b/Assets/Scenes/Game-Mountain.unity index 7028bda..c1337fa 100644 --- a/Assets/Scenes/Game-Mountain.unity +++ b/Assets/Scenes/Game-Mountain.unity @@ -8522,7 +8522,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 384194923} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -439.23712, y: -402.16376, z: -370.48352} + m_LocalPosition: {x: -483, y: 212, z: 915} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1106733121} @@ -16044,7 +16044,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 745779054} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -458.37253, y: -355.46368, z: -498.00574} + m_LocalPosition: {x: -490, y: 287, z: 784} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1579685678} @@ -20379,7 +20379,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!4 &959752957 Transform: m_ObjectHideFlags: 0 @@ -20388,7 +20388,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 959752956} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 964.01154, y: 612.07086, z: 1228.0383} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 2045505414} @@ -45591,7 +45591,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1932658586} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -1973.0115, y: -612.07086, z: -1289.0383} + m_LocalPosition: {x: -2000, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 959752957} @@ -45951,7 +45951,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1942174940} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -473.83752, y: -242.59036, z: -300.25256} + m_LocalPosition: {x: -590, y: 394, z: 973} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1634076210} @@ -46836,7 +46836,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1983875392} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -973.01154, y: -612.07086, z: -1289.0383} + m_LocalPosition: {x: -1000, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 959752957} @@ -48129,7 +48129,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2045505413} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -624.92847, y: -240.80664, z: -580.24896} + m_LocalPosition: {x: -656, y: 399, z: 699} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 288242480} @@ -52574,8 +52574,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5a5d879591af1084ab5d3a35fcd53086, type: 3} m_Name: m_EditorClassIdentifier: - items: [] + networkItemList: [] pStats: {fileID: 0} + invMan: {fileID: 0} --- !u!114 &7616279936114683226 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Environment/Pitfall.cs b/Assets/Scripts/Environment/Pitfall.cs index 1df48d2..3d9690c 100644 --- a/Assets/Scripts/Environment/Pitfall.cs +++ b/Assets/Scripts/Environment/Pitfall.cs @@ -4,18 +4,14 @@ using UnityEngine; public class Pitfall : MonoBehaviour { - // Add a thing where if player touches this we make them respawn cuz they 'fell' + public Vector3 RespawnPoint; //Where player will respawn to, set in GUI - - // Start is called before the first frame update - void Start() + private void OnTriggerEnter(Collider other) { - - } - - // Update is called once per frame - void Update() - { - + if (other.CompareTag("Player")) //If runner enters the trigger cancel momentum, disable controls, and move to set respawn point + { + other.transform.position = RespawnPoint; + other.GetComponent().CancelMomentum(); + } } } diff --git a/Assets/Scripts/PlayerScripts/PlayerMovement.cs b/Assets/Scripts/PlayerScripts/PlayerMovement.cs index 271c775..29bf397 100644 --- a/Assets/Scripts/PlayerScripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerScripts/PlayerMovement.cs @@ -192,8 +192,6 @@ public class PlayerMovement : NetworkBehaviour moveController.Move(driftVel); } - - //Calculates speed current player needs to be going public float PlayerSpeed() { @@ -452,4 +450,24 @@ public class PlayerMovement : NetworkBehaviour } } + public void CancelMomentum() + { + pStats.CurVel = 0; + vel = Vector3.zero; + moveX = Vector3.zero; + moveZ = Vector3.zero; + moveController.enabled = false; + } + + private IEnumerator RespawnTimer() + { + float duration = 2f; + float normalizedTime = 0; + while (normalizedTime <= 1f) + { + normalizedTime += Time.deltaTime / duration; + yield return null; + } + moveController.enabled = true; + } }