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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question FindObjectsOfType<GameObject>().Length;

Discussion in 'Visual Scripting' started by wuannetraam, Mar 29, 2023.

  1. wuannetraam

    wuannetraam

    Joined:
    Oct 29, 2019
    Posts:
    82
    I am looking for something very simple but can't find it in the fuzzy finder.
    "FindObjectsOfType<GameObject>().Length;" I can not find the .length version any advice?
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    1,277
    Try the List Count node, it should auto cast to an array list and get what you need. Visual Scripting doesn't support arrays natively but you can use most list nodes to operate with arrays.
     
    wuannetraam likes this.