feat (orbiting spere): create a sphere that orbiting around thats mimic the living root behaviour

This commit is contained in:
Pierre Ryssen
2026-05-03 17:10:19 +02:00
parent af01c1ee76
commit 360b30370a
3 changed files with 47 additions and 30 deletions

View File

@@ -7,6 +7,7 @@ public class SlowdownArea : MonoBehaviour
public float maxSlow;
public float slowSpeed;
public float timer;
public GameObject playerBody;
[Header("Root Crawler")]
public GameObject rootCrawlerPrefab;
@@ -26,9 +27,10 @@ public class SlowdownArea : MonoBehaviour
jump.JumpForce = 1.5f;
isInZone = true;
if (currentCrawler == null) {
currentCrawler = Instantiate(rootCrawlerPrefab, player.transform.position, Quaternion.identity);
RootCrawler crawler = currentCrawler.GetComponent<RootCrawler>();
crawler.target = player.transform;
currentCrawler = Instantiate(rootCrawlerPrefab);
RootCrawler crawler = currentCrawler.GetComponent<RootCrawler>();
crawler.target = playerBody.transform;
}
}
}