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 Access component without knowing it's type

Discussion in 'Entity Component System' started by prikshitsehrawat, Mar 22, 2023.

  1. prikshitsehrawat

    prikshitsehrawat

    Joined:
    Oct 23, 2020
    Posts:
    1
    So basically to make my script more scalable, I want to access the component of another game object without knowing it's name at runtime.
    Or if possible, I just want to access the first component in hierarchy of another game object.
     
  2. UniqueCode

    UniqueCode

    Joined:
    Oct 20, 2015
    Posts:
    40
    That does not make sense. What are you actually trying to achieve?