• 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

BastianUrbach edited

What is the basic syntax of accessing components?

Mar 9, '20 scripting problem·getcomponent·syntax·accessing

1 Reply

1 Votes

avatar image

hexagonius answered

How can I pause the first person character camera rotation in this case??

Apr 27, '20 c#·camera·getcomponent·rotate object·mouselook

1 Reply

1 Votes

avatar image

dookos commented

C# how to make a script talk to a Coroutine in another script

Feb 21, '19 coroutine·getcomponent

2 Replies

0 Votes

avatar image

Illogical-Ironic edited

getComponent not working with Triggers? Closed

Aug 31, '11 trigger·variable·getcomponent·ontriggerenter

1 Reply

0 Votes

avatar image

asimov edited

Getting Script from Main Camera

Jul 3, '12 camera·getcomponent

1 Reply

0 Votes

avatar image

ShiftedClock commented

NullReferenceException when using GetComponent to access script variables

Sep 14, '12 nullreferenceexception·getcomponent

1 Reply

0 Votes

avatar image

jpvanmuijen edited

Re-run Start() and OnGUI() from another script

Apr 24, '13 c#·getcomponent

0 Replies

0 Votes

avatar image

T27M answered

Checking types for multiple components on a gameobject

May 11, '14 c#·getcomponent

1 Reply

0 Votes

avatar image

InvincibleCat commented

Unity Best Practices - Cached Components

Jan 20, '15 performance·optimization·getcomponent·performance optimization

1 Reply

0 Votes

avatar image

Positive7 answered

How to use "GetComponent().material.color = Color.yellow;"

Sep 2, '15 in Help Room

1 Reply

0 Votes

avatar image

Gianluca90 edited

Error!!! NullReferenceException: Object reference not set to an instance of an object

Jan 17, '17 in Help Room

2 Replies

0 Votes

avatar image

Camilohoyos16 answered

Why we have to use getcomponent instead of a simple reference ?

Aug 16, '17 c#·unity 5·unity5·getcomponent·reference

2 Replies

0 Votes

avatar image

Nomenokes commented

Left hand side of an assignment must be a variable, a property or an indexer

Aug 22, '17 in Help Room

1 Reply

0 Votes

avatar image

peachpieproductions commented

GetComponentInParent doesnt appear to work in editor mode

Sep 9, '18 editor·getcomponent

1 Reply

0 Votes

avatar image

beets0426 commented

Setting thrown object to kinematic after hitting target?

Nov 24, '20 vr·scripting beginner·getcomponent·ontriggerenter·kinematic

1 Reply

0 Votes

avatar image

Showken asked

"GetComponent()" ,"GetComponent() as T","(T)GetComponent()"

Oct 19, '10 getcomponent

1 Reply

-1 Votes

avatar image

jagjit777 commented

what is GetComponent?

Mar 12, '12 getcomponent

1 Reply

-1 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

kobebeef415 commented

Getting Variable value from another object?

Jul 10, '13 variable·getcomponent·boolean

1 Reply

-1 Votes

avatar image

sdgd commented

can someone Repair Manual GetComponent Please

Jan 20, '13 getcomponent·replace·manual

1 Reply

-1 Votes

avatar image

Robomaster commented

Get Component Error

Feb 11, '13 gui·error·getcomponent·bool·disabling

0 Replies

-1 Votes

avatar image

bbbbb123 published

hi I know that this script is seen often but I have an another problem with a damage and health scripts. I think it's the GetComponent part, well anyway if you could help that would be great.

May 2, '13 c#·getcomponent·damage·health

2 Replies

-1 Votes

avatar image

hamstar edited

get component null reference

Oct 1, '13 error·getcomponent·load·null

2 Replies

-1 Votes

avatar image

unimechanic answered

How would Igo about converting this from Java to C#? Closed

Dec 9, '14 getcomponent

1 Reply

-1 Votes

avatar image

Banana13 commented

Can someone translate C# to Javascript?

Feb 19, '14 c#·javascript·getcomponent·boolean

2 Replies

-1 Votes

avatar image

uanmanarmy answered

How do i access a variable from another script?

Apr 15, '14 getcomponent·access

2 Replies

-1 Votes

avatar image

Kiwasi commented

Accessing Scripts from a different Script

Jun 29, '14 getcomponent

1 Reply

-1 Votes

avatar image

Tehnique edited

GetComponent Variable Referenced Twice

Jul 13, '14 variable·getcomponent·control·stats·twice

1 Reply

-1 Votes

avatar image

JeevanjotSingh edited

Where i use Getcomponent() here in this script Closed

Jun 17, '15 unity 5·getcomponent·light

2 Replies

-1 Votes

avatar image

HarshadK answered

attleshipAI.cs(65,90): error CS0176: Static member `battleshipSide.Underattack' cannot be accessed with an instance reference, qualify it with a type name instead

Jul 6, '16 in Help Room

1 Reply

-1 Votes

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

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