• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges

Fixes in upcoming releases of Unity Answers

Using a good tone of voice when replying to posts

Requests for new tags/topics

How to use the META space

How to use the Moderator space

Questions in topic: getcomponent

  • Unanswered Questions
  • Recommended Questions
Once you sign in you will be able to subscribe for any updates here
avatar image

angelonit commented

How to get a component from an object and add it to another? (Copy components at runtime)

May 19, '22 c#·gameobject·getcomponent·component·addcomponent

12 Replies

13 Votes

avatar image

varosi commented

How to get a variable value from another script(C#)? Closed

Jul 14, '17 c#·gameobject·getcomponent

1 Reply

6 Votes

avatar image

spinaljack edited

What's the difference between SendMessage and GetComponent?

Apr 26, '10 getcomponent·sendmessage

3 Replies

5 Votes

avatar image

OP_toss commented

Any way to 'GetComponent' as a base class?

Aug 22, '13 prefab·getcomponent·subclass

2 Replies

5 Votes

avatar image

Bunny83 commented

How to distinguish between multiple components of same type

Mar 16, '18 getcomponent

5 Replies

5 Votes

avatar image

loconeko73 commented

Design Advice: Power Up System (static variables?)

Feb 12, '22 getcomponent·powerup·leveling·static variables·static class

1 Reply

5 Votes

avatar image

VS48 edited

Accessing other objects efficiently

Oct 29, '10 performance·getcomponent·bestpractices

1 Reply

4 Votes

avatar image

Bunny83 commented

GetComponent and interfaces

Nov 5, '15 getcomponent

3 Replies

4 Votes

avatar image

Kourosh commented

How to use getcomponent when there is more than one component with same name is assigned to the gameObject?

Jun 11, '11 getcomponent·unique

1 Reply

4 Votes

avatar image

Nameelee commented

How to get first depth child components of a parent object?

Mar 31, '22 transform·getcomponent·depth·getcomponentinchildren

7 Replies

4 Votes

avatar image

whydoidoit commented

Is GetComponent() slow?

Feb 10, '14 gameobject·getcomponent

1 Reply

4 Votes

avatar image

ammirea edited

GetComponentInChildren Returning a Component in Parent Closed

Dec 2, '19 c#·getcomponent·getcomponentinchildren

4 Replies

4 Votes

avatar image

MDarkwing commented

Getting derived class using base class in GetComponent

Aug 6, '14 getcomponent

1 Reply

4 Votes

avatar image

Seraphic572 commented

get_enabled can only be called from the main thread.

Sep 12, '17 error·getcomponent·unity 4·awake

1 Reply

4 Votes

avatar image

Berlm commented

Accessing the sibling of an object

Jul 18, '20 in Help Room

3 Replies

4 Votes

avatar image

atulvi answered

Why is this generic "Get component if null" code not working

Dec 16, '20 getcomponent·component·null·generics

5 Replies

3 Votes

avatar image

MMoi commented

Inheritance vs RequireComponent

Mar 18, '12 c#·getcomponent·component·inheritance·requirecomponent

-1 Replies

3 Votes

avatar image

KarlKarl2000 edited

Get the child gameObject of a parent and not the Transform

Apr 30, '17 gameobject·getcomponent

4 Replies

3 Votes

avatar image

s_guy commented

Any way to see if a gameObject has a component from MonoDevelop debugger?

Nov 1, '13 getcomponent·monodevelop·component·debugger·watch

0 Replies

3 Votes

avatar image

rutter converted comment to answer

Should GetComponent() generate garbage when the component is not found?

Sep 11, '14 performance·getcomponent·memory·garbage-collection·garbage

1 Reply

3 Votes

avatar image

xandermacleod commented

GetComponent with multiple instances of same script on object

Mar 31, '14 getcomponent·search

1 Reply

3 Votes

avatar image

LeftyTwoGuns commented

Get component in FindGameObjectsWithTag...?

Sep 1, '14 getcomponent·findgameobjectswithtag

1 Reply

3 Votes

avatar image

Rispat-Momit answered

GetComponent() - Is it possible to pass a string variable as name of the script?

Mar 14, '17 gameobject·variable·getcomponent·string

3 Replies

3 Votes

avatar image

JeevanjotSingh answered

Get slider value?

Jan 14, '15 getcomponent·slider·value

2 Replies

3 Votes

avatar image

saadali211 answered

How do I call an enum from another script?

Apr 16, '20 c#·getcomponent·boolean·enum

3 Replies

3 Votes

avatar image

Owen-Reynolds commented

Is there a better way of checking if a gameObject has a component?

Jun 13, '19 in Help Room

1 Reply

3 Votes

avatar image

lhk asked

Type of a script

Nov 1, '10 getcomponent·type

1 Reply

2 Votes

avatar image

Ray-Pendergraph edited

GameObject.AddComponent does not really add a Component?

Dec 17, '10 getcomponent

1 Reply

2 Votes

avatar image

Eric5h5 commented

Are .transform .gameObject .rigidbody component calls or just pointers?

Jul 9, '11 optimization·getcomponent·properties

3 Replies

2 Votes

avatar image

DAQ commented

Accessing variables in another script using GetComponent()

Sep 14, '11 variable·getcomponent·scriptingbasics

0 Replies

2 Votes

  • 1
  • 2
  • 3
  • 4
  • 5
  • ›
  • »

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow This Topic

Follow This Topic

Follow by RSS

8 People are following this topic.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Popular Topics

c# animation android unity 5 camera 2d rotation javascript scripting problem collision ui gui error shader movement gameobject physics rigidbody editor ios texture networking raycast instantiate collider transform terrain mesh prefab input
View all

Recent Badges

  • Famous Question   A_Lego
  • Notable Question   AngeloDon
  • Popular Question   PvTGreg
  • Editor   johnathan080908
  • Notable Question   jfielding74
  • Nice Answer   ItsTwelveOclock
  • Notable Question   xiaolinl
  • Famous Question   Jake398
  • Famous Question   Jake398
  • Notable Question   msaldana


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges