• 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

Lava444 asked

I can't pass arguments into constructor with AddComponent.

1 hour ago gameobject·addcomponent·constructor

0 Replies

0 Votes

avatar image

Keslen published

How do I make a transform on a Child (added by script) apply to that Child instead of its Parent?

Feb 17, '22 transform·parent·child·addcomponent·scripteditor

0 Replies

0 Votes

avatar image

podjigateligrey commented

how do I add link script to gameobject that already exist with attached script

Jul 25, '21 in Help Room

1 Reply

0 Votes

avatar image

doobywoo published

Rigid body component added without me telling it to be added,Rigid body component being added when it is never told to

May 14, '21 rigidbody·prefab·component·addcomponent·automatically

0 Replies

0 Votes

avatar image

khanism edited

How does AddComponent work from the inside?

Jan 28, '21 in Help Room

1 Reply

0 Votes

avatar image

Feathered asked

Why "AddComponent" behaves differently in "Play" and "Edit" modes?

Dec 18, '20 editor·addcomponent

0 Replies

0 Votes

avatar image

streeetwalker answered

,I can't find my .cs file in "Add Component"

Sep 16, '20 in Help Room

1 Reply

0 Votes

avatar image

andrew-lukasik edited

How do I get a CS script in assets to be a stored monobehaviour variable

Jul 21, '20 instantiate·monobehaviour·addcomponent

1 Reply

1 Votes

avatar image

Long2904 commented

How to add audio source to gameobject with PlayOnAwake turn on through script?

Apr 30, '20 audio·audiosource·audioclip·addcomponent·awake

1 Reply

0 Votes

avatar image

streeetwalker edited

Instantiate object through a coroutine problem

Apr 16, '20 in Help Room

1 Reply

0 Votes

avatar image

ericlclancy published

Dynamically adding Javascript to an Instantiated object using AddComponent,Using AddComponent to add a JS Monoscript Causes "NullReferenceException

Mar 14, '20 in Help Room

0 Replies

0 Votes

avatar image

cin31877 answered

Addcompont and Change It's Value After Delete another Same Parent type inheritanced Component ,Addcomponent after DeleteAnother Same MotherType Component And Change It's Value

Feb 1, '20 in Help Room

1 Reply

0 Votes

avatar image

atomodelfinal commented

Can't add sprite to instantiated GameObject

Jan 9, '20 instantiate·getcomponent·spriterenderer·addcomponent

2 Replies

0 Votes

avatar image

Larry-Dietz commented

AddComponent isn't working

Jan 11, '20 in Help Room

1 Reply

0 Votes

avatar image

GameDBharat asked

When i try to add Collider2D or Rigidbody2D through code to prefab gameObject after stopping game the added component remain added to the prefab obejct.

Nov 28, '19 gameobject·rigidbody2d·collider2d·addcomponent

0 Replies

0 Votes

avatar image

puchingeralexander asked

Access Top and Right Variables from RectTransform

Jun 17, '19 in Help Room

0 Replies

0 Votes

avatar image

Hellium answered

How do I change when my RigidBody 2D initializes? C# Question/Noob,How do I change when rigidbody initializes?

May 25, '19 in Help Room

1 Reply

0 Votes

avatar image

WarmedxMints answered

Inconsistent Accessibility: Parameter type is less accessible than method

Mar 4, '19 enum·access·addcomponent·constructor·inconsistent

1 Reply

1 Votes

avatar image

BuckyBall edited

How to add Canvas Scaler and Graphic Raycaster to Canvas in code

Feb 25, '19 in Help Room

1 Reply

0 Votes

avatar image

InternalDissension commented

Is it possible to catch a can't add script error in the editor? Closed

Feb 21, '19 exception·addcomponent·catch

1 Reply

0 Votes

avatar image

cs120319992 edited

Is there a way to add a component to a rigidbody gameobject?

Jan 18, '19 rigidbody·addcomponent

2 Replies

0 Votes

avatar image

Ady_M edited

GetComponent vs AddComponent Closed

Jan 12, '19 gameobject·instantiate·getcomponent·addcomponent

3 Replies

0 Votes

avatar image

Justinger edited

Anyway to add method to other gameobject?

Sep 26, '18 delay·addcomponent

2 Replies

0 Votes

avatar image

Vicarian commented

How to add sphere to other gameObject during runtime?

Jun 21, '18 c#·unity 5·addcomponent

1 Reply

0 Votes

avatar image

JDelekto answered

Any way to use addcomponent to add scripts stored in an array?

Jun 24, '18 component·addcomponent

1 Reply

0 Votes

avatar image

mechanicarts commented

Script component gets attached multiple times

Jun 3, '18 addcomponent

1 Reply

0 Votes

avatar image

Clevereen commented

How to add component to a child of gameobject

Apr 22, '18 gameobject·scriptingbasics·children·addcomponent

3 Replies

0 Votes

avatar image

TreyH edited

Add a script to a GameObject via script at runtime? Closed

Apr 7, '18 in Help Room

1 Reply

1 Votes

avatar image

hexagonius commented

How to destroy a component created in scripts using AddComponent() ?

Apr 14, '18 c#·destroy·addcomponent

2 Replies

0 Votes

avatar image

Fragmental edited

Unity 5.6 - "The type or namespace name `Rigidbody2d' could not be found. Are you missing an assembly reference?" when using AddComponent

Mar 19, '18 in Help Room

1 Reply

0 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.

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