using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameController : MonoBehaviour { public CrateSpawn crateSpawn; public float currentSpeed = 1.06f; void Start() { ChangeSpeed(currentSpeed); } void Update() { if (crateSpawn.hit) { ChangeSpeed(0); } } void ChangeSpeed(float speed) { crateSpawn.speed = speed; } }