• 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

Addcomponent

Cancel

Cancel

All Questions

  • Unanswered Questions
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

Jodll commented

Class constructor

Mar 28, '12 class·addcomponent·constructor

1 Reply

5 Votes

avatar image

K0m1x answered

AddComponent passing variable before Start/Awake

Nov 15, '21 gameobject·variable·start·addcomponent·awake

5 Replies

5 Votes

avatar image

Pyunityer8002 commented

How can I AddComponent() now?

Aug 1, '20 in Help Room

3 Replies

3 Votes

avatar image

asafsitner commented

Instantiate a prefab and add a script to it

Oct 12, '11 c#·instantiate·addcomponent

1 Reply

2 Votes

avatar image

GallopingGames commented

AddComponent() at runtime - variable not being initialized from Inspector

Mar 13, '13 runtime·addcomponent

1 Reply

2 Votes

avatar image

Loius edited

How to GetComponent from Class that uses Generics

May 2, '13 c#·getcomponent·addcomponent·generics

1 Reply

2 Votes

avatar image

LAiKA787SV published

Null Reference at (wrapper managed-to-native)

Jun 5, '13 gameobject·reference·null·addcomponent·wrapper

0 Replies

2 Votes

avatar image

astracat111 published

Attaching a script at runtime

Oct 14, '16 unity 5·scripting problem·addcomponent

2 Replies

2 Votes

avatar image

sisus_co answered

Passing arguments into a constructor via AddComponent

Dec 28, '21 instance·addcomponent·arguments·constructors

5 Replies

2 Votes

avatar image

Dave-Carlile answered

Addcomponent is obsolet, what should i do ? Closed

Jul 18, '17 addcomponent

3 Replies

2 Votes

avatar image

John A C asked

accessing a child

Sep 5, '10 child·children·addcomponent

1 Reply

1 Votes

avatar image

Twayne asked

How can I add a MeshParticleEmitter to a mesh I created dynamically with script?

Nov 18, '10 mesh·addcomponent·particleemitter

1 Reply

1 Votes

avatar image

lee asked

Can't add component GUITexture

Dec 3, '10 gameobject·guitexture·addcomponent

1 Reply

1 Votes

avatar image

chuk155 asked

how do you add a script remotely?

Jan 26, '11 javascript·addcomponent

1 Reply

1 Votes

avatar image

Jesus_Freak commented

AddComponent not working

Jun 18, '11 getcomponent·addcomponent·ignore

3 Replies

1 Votes

avatar image

andre9875 asked

Football free kick question?

Apr 21, '10 rigidbody·velocity·addforce·addcomponent

1 Reply

1 Votes

avatar image

cregox commented

GetComponent and AddComponent with variables for Collider type

Apr 26, '13 c#·editor-scripting·getcomponent·addcomponent·cs0246

2 Replies

1 Votes

avatar image

juanelo commented

Can't add script behaviour ScriptName. The script class can't be abstract!

May 23, '11 addcomponent·abstract

1 Reply

1 Votes

avatar image

Lipis edited

How can I extend a component?

Mar 9, '10 component·addcomponent·extend

1 Reply

1 Votes

avatar image

Corbeau commented

Adding Prefab Components

Sep 11, '11 gameobject·prefab·runtime·addcomponent

1 Reply

1 Votes

avatar image

Bunny83 commented

AddComponent is making Unity crash

Nov 10, '11 crash·addcomponent

2 Replies

1 Votes

avatar image

Demigiant commented

Is there such thing as a recommended Component cap?

Dec 7, '11 performance·destroy·monobehaviour·addcomponent·limitations

0 Replies

1 Votes

avatar image

xpecttrum published

Delete Component at Runtime

May 13, '14 runtime·component·delete·hingejoint·addcomponent

1 Reply

1 Votes

avatar image

NeMewSys commented

How can I get my own gameobject?

Aug 19, '12 gameobject·parent·addcomponent·this·self

2 Replies

1 Votes

avatar image

keinabel commented

Why do I have to re-add my Script on every Unity start?

Jan 29, '13 startup·addcomponent·awake

2 Replies

1 Votes

avatar image

Thuenderman commented

Creating prefab through custom editor window

Apr 12, '14 asset·editorwindow·assetdatabase·addcomponent·custom-editor

1 Reply

1 Votes

avatar image

F00bzor published

Copy collider Component type and parameter to a new Object at runtime

Sep 9, '13 collider·getcomponent·runtime·addcomponent

0 Replies

1 Votes

avatar image

tibithegreat commented

AddComponent calls "start" method sometimes?

Dec 13, '13 addcomponent·flow

1 Reply

1 Votes

avatar image

NbthMnk commented

using addcomponent for buffs, using variable for class

Sep 13, '14 addcomponent

1 Reply

1 Votes

  • 1
  • 2
  • ›

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 instantiate getcomponent component runtime editor monobehaviour unity 5 prefab type rigidbody destroy scripting problem script. child inheritance classes nullreferenceexception javascript instance class components hingejoint error


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