Assets/SpawnPoint.cs(11,39): error CS0120: An object reference is required to access non-static member `UnityEngine.Component.transform'
Мой скприт
using UnityEngine;
public class SpawnPoint : MonoBehaviour {
public GameObject spawnPoint;
public GameObject objToSpawn;
void Update () {
if (Input.GetKeyDown(KeyCode.F))
{
Instantiate(objToSpawn, SpawnPoint.transform.position, Quaternion.identity);
}
}
}
С пробелами все нормально
-
Вопрос задан
-
33 просмотра