Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

does not contain a definition for 'Y' and no accessible extension method 'Y' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?,

$
0
0
i want my obs1 which is a game object to practicly teleport to a another game object and then move towards a randomly selected object from an array of gameobjects but it shows me the error from the title and i dont know how to solve it can someone help me? public class obs1script : MonoBehaviour { public GameObject[] location1; public GameObject[] location2; public float firstphase = 45f; public float first; int index1,index2; Vector2 target; void Start() { first = Time.time + firstphase; } void FixedUpdate() { index1 = Random.Range(0,location1.Length); transform.position = new Vector2(location1[index1].X,location1[index1].Y); index2 = Random.Range(0,location2.Length); target = location2[index2].transform.position; transform.position = Vector2.MoveTowards(transform.position,target,0.1f); } } the problem is here: transform.position = new Vector2(location1[index1].X,location1[index1].Y); index2 = Random.Range(0,location2.Length);

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>