// Start is called before the first frame update void Start() { tunnelMover = GetComponent <TunnelMovement>(); lastPlatform = tunnelMover.startPlatform; // Ensure the start platform is always 3 seconds long float startPosition = lastPlatform.transform.position.z - lastPlatform.transform.localScale.z / 2f; float size = tunnelMover.speed * 3f; SizePlatform(lastPlatform, size); PositionPlatform(lastPlatform, startPosition, 0); }
private void Awake() { mov = GetComponent <TunnelMovement>(); }