So i have this as my “spawning code”
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TileManager : MonoBehaviour
{
public GameObject[] tilePrefabs;
public float zSpawn = 0;
public float tileLenght = 30;
void Start()
{
SpawnTile(0);
SpawnTile(1);
SpawnTile(4);
}
// Update is called once per frame
void Update()
{
}
public void SpawnTile(int tileIndex)
{
Instantiate(tilePrefabs[tileIndex], transform.forward * zSpawn, transform.rotation);
zSpawn += tileLenght;
}
}
Somehow it set the location of it at 0 0 0. I want it at another point in my program.
{Video Of the bug}
How can I change the location?
EDIT: I use this tutorial but he doesn’t show it how: