I’m trying to add Specific game objects and their position to an array so they can be Instantiated afterwards in their positions? I know how to add the gameobjects to an Array but not their positions. Anyone got any clues?
public GameObject[] Objects;
public GameObject Ball;
void Update() [
if(Input.GetKeyDown(KeyCode.Space)) {
Objects.Add(Ball);
}
else if (Input.GetKeyDown(KeyCode.Enter)) {
Instantiate(Objects, transform.position, transform.rotation);
}
}