What I have are 4 platforms that I instantiate at 4 locations. What I want is for the platforms to be shuffled every time. My code so far:
using UnityEngine;
public class PlatformCreator : MonoBehaviour {
public GameObject[] platforms;
public Transform[] points;
private void Start()
{
for (int i = 0; i < points.Length; i++)
{
Instantiate(platforms[i], points[i].position, Quaternion.identity);
}
}
}
For example the platforms now always spawn in the same order - pink, yellow, blue, purple
I want them to be spawned in different order every time, for example - yellow, blue, purple, pink. I've tried creating an int index with random.range, but I am messing something up