• 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

Getcomponent

Cancel

Cancel

All Questions

  • Unanswered Questions
avatar image

MMoi commented

Inheritance vs RequireComponent

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

-1 Replies

3 Votes

avatar image

Jessy edited

How to trigger a script in another game object

Jan 15, '11 trigger·getcomponent·bce0018

1 Reply

0 Votes

avatar image

Ted-Brown commented

Can you shorten "GameObject.GetComponent(Script)" to a variable?

Aug 9, '11 getcomponent

3 Replies

0 Votes

avatar image

Bill Cosby commented

(C#) If statements based on variables in another script

Nov 18, '12 c#·getcomponent·boolean·triggers·if statement

1 Reply

0 Votes

avatar image

Grasshorse commented

Passing a Variable to an Instance

Jun 9, '11 instantiate·variable·getcomponent

2 Replies

0 Votes

avatar image

Tabu asked

GetComponentInChildren, is there an Alternative way?

Aug 3, '10 getcomponent·getcomponentinchildren

1 Reply

0 Votes

avatar image

VS48 edited

Accessing other objects efficiently

Oct 29, '10 performance·getcomponent·bestpractices

1 Reply

4 Votes

avatar image

Bunny83 commented

Assigning id to instantiated objects

Nov 23, '11 instantiate·getcomponent·id

1 Reply

0 Votes

avatar image

Plajen rolled back

GetComponent(string) with unknown ScriptName

Jun 1, '19 getcomponent·string·delegate

2 Replies

1 Votes

avatar image

movAX13h edited

Can't use GetComponent in C#

Apr 21, '15 nullreferenceexception·getcomponent

3 Replies

0 Votes

avatar image

genail edited

Is there a way to GetComponent() with space in its name? (using #pragma strict)

Jul 8, '12 javascript·getcomponent·strict

1 Reply

1 Votes

avatar image

Mattivc asked

Making a GetComponent array

Aug 8, '10 javascript·array·iphone·optimization·getcomponent

1 Reply

0 Votes

avatar image

nightbane30 commented

GetComponent with Standard Assets? C#

Mar 19, '16 c#·getcomponent·standard assets

1 Reply

1 Votes

avatar image

Lovrenc edited

GetComponent doesn't work anymore

Jan 19, '13 getcomponent·nullreference

2 Replies

0 Votes

avatar image

Romano185 answered

Variable of prefab has not been assigned

Feb 12, '12 instantiate·prefab·getcomponent·findwithtag

2 Replies

0 Votes

avatar image

Zentiu answered

Accessing a GameObject from another script

Mar 20, '20 transform·getcomponent·findgameobjectswithtag

1 Reply

0 Votes

avatar image

Silx commented

#pragma strict GetComponent from Javascript to C# fails

Jan 9, '12 getcomponent·bce0018

2 Replies

0 Votes

avatar image

Bunny83 commented

How can i get a Transform component from an other object's script?

May 6, '12 object·getcomponent·target

1 Reply

-1 Votes

avatar image

Silv3r_Energy commented

Error CS0305: Using the generic method `UnityEngine.Component.GetComponent()' requires `1' type argument(s)

Dec 6, '17 getcomponent

1 Reply

0 Votes

avatar image

ronronmx asked

Best way to GetComponent with #pragma strict

Dec 28, '10 getcomponent·pragmastrict

3 Replies

0 Votes

avatar image

highpockets commented

Using GetComponent in multiple scripts for same component? C#

Mar 15, '14 c#·getcomponent·component

2 Replies

1 Votes

avatar image

Rennat commented

Cache GetComponent correctly in C#

Aug 15, '11 c#·button·getcomponent·elevator

2 Replies

1 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

Ray-Pendergraph edited

GameObject.AddComponent does not really add a Component?

Dec 17, '10 getcomponent

1 Reply

2 Votes

avatar image

princeadj14 commented

How to get the value of a boolean in game object to another Game object script.

Nov 21, '13 getcomponent·gameobject.find·booleans

1 Reply

0 Votes

avatar image

Ashkan_gc edited

accessing script components from external objects

Sep 1, '10 getcomponent·ontriggerenter

2 Replies

0 Votes

avatar image

StandAloneStudio answered

How to get a single Text component from one of multiple children all containing Text components

Apr 13, '20 gameobject·getcomponent

2 Replies

0 Votes

avatar image

Mystfit edited

Using GetComponent with base classes

Oct 26, '13 getcomponent·generics·derived-class

2 Replies

1 Votes

avatar image

Bip901 edited

How do I get the type of a Monobehaviour?

Oct 27, '18 in Help Room

2 Replies

0 Votes

avatar image

Bill Cosby commented

C# - Problem with trigger that won't activate

Oct 1, '12 c#·trigger·getcomponent·ontriggerenter

1 Reply

0 Votes

  • »
  • ‹
  • 5
  • 6
  • 7
  • 8
  • 9
  • ›
  • »

Followers

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

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.

Related Topics

c# gameobject variable javascript instantiate scripting problem nullreferenceexception component error array unity 5 script. prefab variables boolean reference ui string find transform ontriggerenter text raycast type function


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