Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 RowleyBirkin · Jul 19, 2012 at 10:03 AM · rigidbodycollidermeshscalesize

Can you scale a Mesh independently of it's Collider?

Hey there guys,

My objective is to scale an active rigid body's size (perhaps only the mesh renderer?!) without affecting it's collider. The scaling is intended to be minor, very brief and usually whilst the object is in the air and not contacting any other objects. There will be times when this object is in contact with the ground though and I'd obviously like to avoid physics abnormalities.

Ideally I'd like to use iTween's punchScale function, unfortunately this automatically sets the object to kinematic whilst in operation. This causes obvious glitching.

The only way around this that I can think of is scaling the collider down first, immediately followed by scaling the object's transform up so that effectively the collider remains relatively the same size. I don't like this solution as not only is it only possible on objects with a few of the simple unity colliders (sphere - radius, box, maybe capsule), it seems messy, hacky and unnecessarily expensive!

Can anyone throw me a bone?

Many thanks in advance,

Rowley

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

1 Reply

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

Answer by whydoidoit · Jul 19, 2012 at 10:44 AM

Have the collider attached to a different branch or object in the hierarchy from the object with the renderer. Then just scale the object with the collider and leave the other object/branch alone.

         Player ------->  Player Rendering Object
                  |---->  Player Colliding Object
Comment
Add comment · Show 3 · 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 RowleyBirkin · Jul 19, 2012 at 06:51 PM 0
Share

Wow, I can't believe I didn't think of that slaps forehead. I'll blame it on a brain-fart! Thanks $$anonymous$$ike, you're a legend!

avatar image RowleyBirkin · Jul 19, 2012 at 08:56 PM 0
Share

Thinking about it a little whilst at work, I'm guessing the rendering object needs to be the child of the actual colliding object and not the other way around. If the colliding object is a child of the rendering object (which I am scaling) the collider would inherit the rendering object's scale no? Regardless I have some testing/experimenting to do when I get home! Thanks again.

avatar image RowleyBirkin · Jul 20, 2012 at 09:31 PM 0
Share

Tried it and it worked like a charm!

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Scaling the Mesh Collider 4 Answers

Scale collider independent of gameObject. 1 Answer

Set Colliders at same size 2 Answers

Why attach a kinematic rigidbody to a collider that moves a lot? 1 Answer

Catapult question 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