Как исправить данную ошибку? Скрипт не может найти предмет, координаты которого я пытаюсь узнать, хотя на сцене он присутствует.
error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `position' and no extension method `position' of type `UnityEngine.GameObject' could be found (are you missing a using directive or an assembly reference?)
|
GameObject[] weaps = GameObject.FindGameObjectsWithTag("rv");
foreach (GameObject weap in weaps) {
if (Vector3.Distance(weap.position, myTransform.position) < 4.0F) {
if (Input.GetKeyUp("g")) {
weapon2_e = true; weapon1_e = false; weapon2_e = false;
weapon2_rv_pick = true; }
}
}