Search Issue Tracker

Fixed in 4.5.X

Votes

0

Found in

4.3.0b5

Issue ID

569426

Regression

No

Can add script that requires component that is conflicting with object's existing components

Scripting

-

1. Create object.
2. Add Rigidbody2D to the object
3. Create script like this:
[RequireComponent(typeof(Rigidbody))]
public class A : MonoBehaviour {}
4. Add it to the object.

You'll get error
"Can't add component 'Rigidbody' to Sphere because it conflicts with the existing 'Rigidbody2D' derived component!"
But component A will be still added to the object
You can do the same from a script. You can see it using AddA.cs script

Comments (34)

  1. unity_K99WJS2TxGpRtA

    Mar 19, 2020 09:27

    This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!.
    http://www.wdrs.org.uk http://www.wdrs.org.uk

  2. unity_K99WJS2TxGpRtA

    Mar 16, 2020 16:54

    I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..
    Zahnarztpraxis Luzern https://www.drsternina.ch/

  3. unity_K99WJS2TxGpRtA

    Mar 14, 2020 05:01

    Its a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work.
    Zahnarztpraxis Bern https://www.dentcenter.ch/

  4. unity_K99WJS2TxGpRtA

    Mar 09, 2020 09:08

    I am very much pleased with the contents you have mentioned. I wanted to thank you for this great article.
    Cabin Rentals Twain Harte https://farmsoftuolumnecounty.org/markets/fun-cabin-rentals/

Add comment

Log in to post comment