Legacy Documentation: Version 2018.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Component.GetComponents

public Component[] GetComponents(Type type);

Parameters

typeThe type of Component to retrieve.

Description

Returns all components of Type type in the GameObject.

no example available in C#

public T[] GetComponents();

Description

Generic version. See the Generic Functions page for more details.

Did you find this page useful? Please give it a rating: