Example #1
0
    void Start()
    {
        spawner = GameObject.FindGameObjectWithTag("ObstacleSpawner").GetComponent<ObstacleSpawner>();
        player = GameObject.FindGameObjectWithTag("Player").transform;
        thisTransform = transform;
        startPosition = thisTransform.position;

        if(SpawnOnStart)
        {
            spawner.SpawnNew(thisTransform.position.x);
        }
    }