feat (root crawler): start the vine grip around the player body when it enter in the slowdown area

This commit is contained in:
Pierre Ryssen
2026-05-03 15:14:29 +02:00
parent 6b3913fe2b
commit af01c1ee76
6 changed files with 298 additions and 9 deletions

View File

@@ -2,15 +2,20 @@ using UnityEngine;
public class RootCrawler : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
public Transform target;
public float maxHeight;
public float crawlingSpeed;
private float height = 0f;
// Update is called once per frame
void Update()
{
if (target == null)
return;
height += Time.deltaTime * crawlingSpeed;
height = Mathf.Clamp(height, 0f, maxHeight);
transform.position = target.position + Vector3.up * height;
}
}