Error when editing variables of Gameoject script that are in array

264 views Asked by At

in my code where it says "aICurrentLevel = go.GetComponent" I am getting an error back from MonoDevelop that says "This request is not supported by the protocol version implemented by the debuggee." Does anyone know why it is saying this? I have been digging around for a while on the internet to find that answer but can't seem to find it. All help is much appreciated. Overall what I am trying to do in this code is:

  1. Add all game object with the tag "LadderPlacmentObject" into an array of Gameobjects.

  2. Change the value of aICurrentLevel to the value found in the game object script.

  3. If the game object is active and has the same level, show text in my console.

    void FindLadderObjects()
    {
    
    float aICurrentLevel;
    
    
    GameObject[] allLadderPlacmentObjects = GameObject.FindGameObjectsWithTag("LadderPlacmentObject");
    foreach (GameObject go in allLadderPlacmentObjects) 
    {
    
        aICurrentLevel = go.GetComponent<LadderObjectInfo>().currentLevel;
    
    
    
            if (go.activeInHierarchy && aICurrentLevel == aILevel) 
        {
    
            Debug.Log ("Found some to move too");
    
        }
    
      }
    }
    
0

There are 0 answers