Hi, i was making a platformer level generator and for some reason whenever i generate the new platforms they dont load in properly, they are there but you cant see them on the game window. this is my first time using the forum so im not really sure how ask for help.
`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Generator : MonoBehaviour
{
public GameObject thePlatform;
public Transform generationPoint;
public float distancebetween;
public GameObject[] thePlatforms;
private int platformSelector;
public float platformNumber;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(platformNumber >= 0 && transform.position.x < generationPoint.position.x)
{
transform.position = new Vector3(transform.position.x + distancebetween, transform.position.y, transform.position.z);
platformSelector = Random.Range(0, thePlatforms.Length);
Instantiate(thePlatforms[platformSelector], transform.position, transform.rotation);
platformNumber --;
}
}
}`