Search Unity

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:
    65
    That does not make sense. What are you actually trying to achieve?