Skip to content

Commit

Permalink
prepare scavenger respawn system
Browse files Browse the repository at this point in the history
  • Loading branch information
Taliayaya committed Sep 17, 2023
1 parent 91d0906 commit efcb3d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Assets/Scripts/Gameplay/ScavengerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,14 @@ public void GoTo(Vector3 dest)

private void Follow()
{
if (!master)
{
State = ScavengerState.Idle;
return;
}

var distance = Vector3.Distance(transform.position, master.transform.position);
if (!master || distance < followDistance)
if (distance < followDistance)
{
State = ScavengerState.Idle;
return;
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Gameplay/ScavengerMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ScavengerMaster : MonoBehaviour
[SerializeField] private float spawnDistance = 8;
[SerializeField] private float maxRaycastDistance = 4000;
[SerializeField] private LayerMask raycastLayerMask;
[SerializeField] private bool respawnScavengerOnDeath = true;


[Header("References")] [SerializeField]
Expand Down

0 comments on commit efcb3d4

Please sign in to comment.