• 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

Requirecomponent

Cancel

Cancel

All Questions

  • Unanswered Questions
avatar image

NMJ_GD edited

Is it overkill to RequireComponent then check if GetComponent isnt Null in Awake?

Feb 14, '21 in Help Room

1 Reply

0 Votes

avatar image

ahstein commented

Equivalent to RequireComponent attribute for prefab reference?

Nov 11, '20 prefab·requirecomponent

1 Reply

1 Votes

avatar image

Bunny83 answered

RequireComponent - At least one of multiple types

Apr 19, '20 requirecomponent

1 Reply

1 Votes

avatar image

Develax answered

Require inspector assignment?

Jun 1, '19 inspector·assignment·requirecomponent

5 Replies

3 Votes

avatar image

Rafarel commented

RequireComponent (typeof) not adding in component

Apr 14, '19 in Help Room

2 Replies

3 Votes

avatar image

tormentoarmagedoom commented

Create a clone without components at runtime

Feb 5, '19 in Help Room

0 Replies

1 Votes

avatar image

Fuzzinator commented

myObjetc..GetType().GetCustomAttributes(typeof(RequireComponent) not working correctly

Oct 31, '18 c#·scripting problem·editor·editor-scripting·requirecomponent

1 Reply

1 Votes

avatar image

stevesan asked

Check RequireComponent on existing scenes/prefabs when new annotation is added?

Jul 8, '18 components·requirecomponent

0 Replies

1 Votes

avatar image

stng answered

How Can I Get the Parent GameObject from Within a Component (C#)

Jun 29, '18 capsulecollider·requirecomponent

4 Replies

0 Votes

avatar image

Bunny83 answered

How to set the property of my required component?

Oct 14, '17 collider2d·requirecomponent

2 Replies

0 Votes

avatar image

Stamblew commented

Add two components of the same type using RequireComponent attribute

Aug 23, '17 editor·component·requirecomponent

1 Reply

0 Votes

avatar image

Hauthorn asked

Is it possible to have RequireComponent auto add two of the same component?

May 23, '17 in Help Room

0 Replies

0 Votes

avatar image

hexagonius answered

[FIXED] 2D Platformer – The name Seeker does not exist in current context

Mar 18, '17 c#·scripting problem·astar·using·requirecomponent

1 Reply

0 Votes

avatar image

Buzzrick answered

Is it possible to use || (or) with RequireComponent?

Feb 8, '17 inheritance·requirecomponent

5 Replies

8 Votes

avatar image

Pengocat commented

Require Component not showing in inspeector

Feb 5, '17 inspector·requirecomponent

0 Replies

0 Votes

avatar image

Naphier commented

It is posible to add a [RequireComponent (typeof( xxxx ))] but with Global Fog ?

Oct 21, '16 requirecomponent

2 Replies

0 Votes

avatar image

rockear commented

Does not work: @script RequireComponent(AudioSource)

Sep 1, '16 audiosource·requirecomponent

0 Replies

0 Votes

avatar image

DewDrop commented

Is RequireComponent[typeof(CustomScript)] possible?

Apr 19, '16 custom·attribute·requirecomponent

1 Reply

3 Votes

avatar image

phil_me_up answered

RequireComponent for built in components

Jan 24, '16 in Help Room

1 Reply

0 Votes

avatar image

rasield published

I am looking to add a class as a component to a prefab and have that class be a requiredcomponent of the script. Is this possible or am I wasting my time?

Oct 4, '15 inspector·component·classes·custom-inspector·requirecomponent

2 Replies

0 Votes

avatar image

webik150 commented

How to check if class has RequireComponent on it?

Aug 29, '15 in Help Room

1 Reply

0 Votes

avatar image

demented_hedgehog edited

RequireComponent, but don't automatically add it

Aug 14, '15 requirecomponent

4 Replies

4 Votes

avatar image

michaeljota published

GetComponet() returning null with require component script

Aug 12, '15 nullreferenceexception·getcomponent·requirecomponent

1 Reply

0 Votes

avatar image

B-dax published

How do you prevent a base class from being addable as a script without making it abstract?

Jun 18, '15 inheritance·requirecomponent

0 Replies

1 Votes

avatar image

Aggressor commented

RequireComponent only blocks removal? Can I force a warning if missing at runtime?

Feb 26, '15 requirecomponent

1 Reply

0 Votes

avatar image

rutter commented

Require Component for Parent

Sep 16, '14 parent·requirecomponent

2 Replies

1 Votes

avatar image

Evorlor commented

RequiredComponent with Custom Types

Aug 30, '14 types·requirecomponent

1 Reply

0 Votes

avatar image

smoggach answered

Dynamically removing required components when destroying

Aug 15, '14 destroy·requirecomponent

1 Reply

0 Votes

avatar image

ypsilon commented

"Injecting" an interface into an object

Jun 25, '14 inheritance·abstract·requirecomponent

1 Reply

1 Votes

avatar image

perchik commented

RequireComponent with custom public vars?

Feb 25, '14 editor·editor-scripting·public variable·requirecomponent

1 Reply

0 Votes

  • 1
  • 2
  • ›

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Related Topics

c# component inheritance getcomponent scripting problem editor editor-scripting inspector bug nullreferenceexception components destroy audiosource reflection parent designer addcomponent list prefab managed animation astar selection particleemitter assignment
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges