The respawwn system is now ppicking up the position of the player correctly. However, still not sending the player to the last known respawn point.

This commit is contained in:
Programmer-DField 2021-02-26 17:08:41 +00:00
parent 2773c3f954
commit 078e356810
5 changed files with 44 additions and 47 deletions

View File

@ -96,6 +96,7 @@ GameObject:
- component: {fileID: 13726836969441782} - component: {fileID: 13726836969441782}
- component: {fileID: 13726837176080779} - component: {fileID: 13726837176080779}
- component: {fileID: 3320306143821152633} - component: {fileID: 3320306143821152633}
- component: {fileID: 1646361029}
m_Layer: 0 m_Layer: 0
m_Name: Player m_Name: Player
m_TagString: Player m_TagString: Player
@ -313,6 +314,25 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 005bf73dff204914c9e1bbd60c843451, type: 3} m_Script: {fileID: 11500000, guid: 005bf73dff204914c9e1bbd60c843451, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!95 &1646361029
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 13726836969441781}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: bd12efafa4115114f90ba79feeb4e8b0, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &13726837293638831 --- !u!1 &13726837293638831
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -174,7 +174,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 34418842} m_GameObject: {fileID: 34418842}
m_Enabled: 1 m_Enabled: 0
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4a7f7dc8ddb842944abcbcbb1d4995f5, type: 3} m_Script: {fileID: 11500000, guid: 4a7f7dc8ddb842944abcbcbb1d4995f5, type: 3}
m_Name: m_Name:
@ -1163,10 +1163,18 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 13726836969441545, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 13726836969441781, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} - target: {fileID: 13726836969441781, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: Player value: Player
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 13726836969441783, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3}
--- !u!1 &1544718414 --- !u!1 &1544718414
@ -1339,53 +1347,22 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1646361021 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 13726836969441781, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3}
m_PrefabInstance: {fileID: 1528237030}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1646361025 stripped --- !u!114 &1646361025 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 13726836969441780, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3} m_CorrespondingSourceObject: {fileID: 13726836969441780, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3}
m_PrefabInstance: {fileID: 1528237030} m_PrefabInstance: {fileID: 1528237030}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1646361021} m_GameObject: {fileID: 0}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!95 &1646361029 --- !u!95 &1646361029 stripped
Animator: Animator:
serializedVersion: 3 m_CorrespondingSourceObject: {fileID: 1646361029, guid: 5efe0b059275dbe48a4108d03ad03fd9, type: 3}
m_ObjectHideFlags: 0 m_PrefabInstance: {fileID: 1528237030}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1646361021}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: bd12efafa4115114f90ba79feeb4e8b0, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!114 &1646361030
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1646361021}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4a7f7dc8ddb842944abcbcbb1d4995f5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1853827072 --- !u!1 &1853827072
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1399,7 +1376,7 @@ GameObject:
- component: {fileID: 1853827076} - component: {fileID: 1853827076}
- component: {fileID: 1853827075} - component: {fileID: 1853827075}
- component: {fileID: 1853827074} - component: {fileID: 1853827074}
m_Layer: 0 m_Layer: 3
m_Name: SafeZone m_Name: SafeZone
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
@ -1414,7 +1391,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853827072} m_GameObject: {fileID: 1853827072}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.62, y: -9.48, z: 1.83} m_LocalPosition: {x: -7.2, y: -9.19, z: -45.53}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 565379240} m_Father: {fileID: 565379240}
@ -1453,7 +1430,7 @@ MeshRenderer:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853827072} m_GameObject: {fileID: 1853827072}
m_Enabled: 0 m_Enabled: 1
m_CastShadows: 1 m_CastShadows: 1
m_ReceiveShadows: 1 m_ReceiveShadows: 1
m_DynamicOccludee: 1 m_DynamicOccludee: 1
@ -1465,7 +1442,7 @@ MeshRenderer:
m_RenderingLayerMask: 1 m_RenderingLayerMask: 1
m_RendererPriority: 0 m_RendererPriority: 0
m_Materials: m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} - {fileID: 2100000, guid: c7c9da98e081aaa43883652afefc74b3, type: 2}
m_StaticBatchInfo: m_StaticBatchInfo:
firstSubMesh: 0 firstSubMesh: 0
subMeshCount: 0 subMeshCount: 0

View File

@ -15,8 +15,8 @@ public class SafeZone : MonoBehaviour
// Check to see if other collider is Player. If true set player to other game object. // Check to see if other collider is Player. If true set player to other game object.
if (other.gameObject.CompareTag("Player")) if (other.gameObject.CompareTag("Player"))
{ {
isSafe = true;
player = other.gameObject; player = other.gameObject;
isSafe = true;
} }
} }

View File

@ -5,7 +5,7 @@ using UnityEngine.InputSystem;
public class DeathZone : MonoBehaviour public class DeathZone : MonoBehaviour
{ {
public Animator animator; public Animator animator;
//public GameObject fadeScreen; public GameObject fadeScreen;
private GameObject player; private GameObject player;
@ -28,11 +28,11 @@ public class DeathZone : MonoBehaviour
_playerInput.enabled = false; _playerInput.enabled = false;
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
//fadeScreen.GetComponent<Animator>().SetTrigger("fadeToBlack"); fadeScreen.GetComponent<Animator>().SetTrigger("fadeToBlack");
//yield return new WaitForSeconds(1.5f); yield return new WaitForSeconds(1.5f);
player.transform.position = respawnManager.GetRespawnPoint(); player.transform.position = respawnManager.GetRespawnPoint();
//fadeScreen.GetComponent<Animator>().SetTrigger("fadeToClear"); fadeScreen.GetComponent<Animator>().SetTrigger("fadeToClear");
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
_playerInput.enabled = true; _playerInput.enabled = true;

View File

@ -21,6 +21,6 @@ public class RespawnManager : MonoBehaviour
// Show current respawn point in log. This can be deleted at later stage. // Show current respawn point in log. This can be deleted at later stage.
private void Update() private void Update()
{ {
Debug.Log(respawnPoint); Debug.Log("Respawn point is: " + respawnPoint);
} }
} }