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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How get a random object with class with a bool equaling false

Discussion in '2D' started by KoiMcF, May 27, 2020.

  1. KoiMcF

    KoiMcF

    Joined:
    Aug 25, 2019
    Posts:
    2
    Is there a way in Unit where I can call all objects with a class and a bool or int int that class equaling something? Like

    Card[] card = FindObjectsOfType<Card>().cardNumber == 1;
    That dosnt work but you get the idea.
     
    Last edited: May 27, 2020
  2. SaoSilver

    SaoSilver

    Joined:
    May 27, 2020
    Posts:
    9
    You'll want to use LINQ