Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question FindGameObjectWithTag ERROR

Discussion in 'Scripting' started by Hannibal11, Jan 22, 2021.

  1. Hannibal11

    Hannibal11

    Joined:
    Mar 5, 2020
    Posts:
    15
    Hi everyone,
    I'm trying to populate my array with GameObjects that have this tag, but it gives me this error:

    "error CS0029: Cannot implicitly convert type 'UnityEngine.GameObject' to 'UnityEngine.GameObject[]'"
     

    Attached Files:

  2. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,657
  3. Hannibal11

    Hannibal11

    Joined:
    Mar 5, 2020
    Posts:
    15
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    When a GameObject is instantiated, it should have the same tag as the original. Are you modifying tags anywhere in your code?
     
    Hannibal11 likes this.