using UnityEngine; public class DinoVFXController : MonoBehaviour { public DinoPlayer player; public ParticleSystem dust; public TrailRenderer speedTrail; public GameObject speedLines; public float boostThreshold = 1.1f; public float dustMinSpeed = 0.1f; void Awake() { if (player == null) player = GetComponentInParent(); } void Update() { if (player == null || player.ncc == null) return; bool grounded = player.ncc.IsGrounded; bool boosting = player.SpeedMultiplier >= boostThreshold; bool moving = player.IsAlive; if (dust != null) { if (grounded && moving) { if (!dust.isPlaying) dust.Play(); } else { if (dust.isPlaying) dust.Stop(); } } if (speedTrail != null) speedTrail.emitting = boosting; if (speedLines != null) speedLines.SetActive(boosting); } }