- Home /
Targetting error please help
Errors
Assets/skriptai/nukreipimas.cs(17,28): error CS0029: Cannot implicitly convert type `UnityEngine.GameObject[]' to `UnityEngine.GameObject'
Assets/skriptai/nukreipimas.cs(19,17): error CS1579: foreach statement cannot operate on variables of type `UnityEngine.GameObject' because it does not contain a definition for `GetEnumerator' or is not accessible
Script
using UnityEngine; using System.Collections; using System.Collections.Generic;
public class nukreipimas : MonoBehaviour { public List tikslai;
// Use this for initialization void Start () { tikslai = new List();
Addpriesu(); }
public void Addpriesu() { GameObject go = GameObject.FindGameObjectsWithTag("Priesas"); foreach(GameObject Priesas in go) Addipriesu(Priesas.transform); }
public void Addtaikiny (Transform Priesas) { tikslai.Add(Priesas); }
// Update is called once per frame void Update () { } }
We can't read that. You need to use the 101/010 button to format your code. You've gotten this response on all of your questions so far; perhaps you should actually do it.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
MonoDevelope is not opening! 1 Answer
varification error in editor script 1 Answer
Need help calling a script to another keep getting errors 1 Answer
error in code (Please help) 1 Answer