Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question FindObjectsOfType<GameObject>().Length;

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

  1. wuannetraam

    wuannetraam

    Joined:
    Oct 29, 2019
    Posts:
    87
    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:
    2,126
    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.