Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
  • Home /
avatar image
0
Question by Vandive · Apr 07, 2016 at 12:36 PM · collider2dsize

BoxCollider2D.size is not a member of Collider2D.

The problem is that the unity manual says to change the size of a box collider you have to go and set the .size of the object. Apparently unity dose not have this as a member of Collider2D. Is this a bug with a unity 5.4 Build or am i doing this wrong.

The .size gets highlighted in red in mono develop.

         Coll2 = Building[Item].GetComponent <BoxCollider2D> ();
         Spr2 = Building[Item].GetComponent <SpriteRenderer> ();
 
         Spr.sprite = Spr2.sprite;
         Coll2.size = Coll.size;
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by MelvMay · Apr 07, 2016 at 12:40 PM

You don't specify what you've defined 'Coll2' as. If it's of type Collider2D then it won't work as Collider2D doesn't have a 'size' property. Define it as BoxCollider2D then it'll obviously have that property.

Funny how you think this could be a bug in Unity. ;)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Vandive · Apr 07, 2016 at 10:03 PM 0
Share

I was using the unity 5.4 beta build and they can have some strange bugs sometimes.

avatar image MelvMay ♦♦ Vandive · Apr 08, 2016 at 08:24 AM 0
Share

Yeah, certainly there are bugs but that would be a huge one and completely break Unity, :)

Anyway, glad you got it working and good luck with your project!

avatar image
0

Answer by Vandive · Apr 07, 2016 at 10:12 PM

For any users that may concern i looked at the variable i declared and instead as a box collider i used a collider so i guess i should look everywhere for the problem next time.

Thanks for your answer @MelvMay

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Two colliders in one Game Object, one is trigger. How to change size of both? 1 Answer

Rectangle handle size 1 Answer

Scale Specific Particle dimensions possible??? 3 Answers

Changing the size of a GUI label 1 Answer

Size Grow (ParticleAnimator). How does this work exactly? 2 Answers


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