it feels like I’m doing something because there’s no reference of the variable of another script in the dropdown list. pls help?
[SerializeField]
private gm MainPlatform;
public Transform SidePlatform;
private Vector3 NextSpawnSidePlatform;
void Start()
{
MainPlatform = GameObject.FindWithTag("gameManager").GetComponent<gm>();
NextSpawnSidePlatform.x = 30.5f;
StartCoroutine(SpawnSidePlatform());
}
void Update()
{
}
IEnumerator SpawnSidePlatform()
{
yield return new WaitForSeconds(0.5f);
Instantiate(SidePlatform, NextSpawnSidePlatform, Quaternion.identity);
NextSpawnSidePlatform.z += 8.5f;
NextSpawnSidePlatform.x = 30.5f;
StartCoroutine(SpawnSidePlatform());
}
And this is another script which i want to make a reference to
public class gm : MonoBehaviour
{
public gmSidePlatform platformTwo;
public Transform tileObj;
private Vector3 nextTileSpawn;
public Transform obstacleobj;
private Vector3 nextObsSpawn;
public Transform obsTwoObj;
private Vector3 nextobstwoSpawn;
private float Randx;
public void Start()
{
platformTwo = GameObject.FindWithTag("SidePlatform").GetComponent<gmSidePlatform>();
nextTileSpawn.z = 40; // to set the position where it spawn (vector3)
StartCoroutine(spawnTile());
}
public IEnumerator spawnTile()