Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 UNKNOWN or whatever · Apr 29, 2011 at 11:55 AM · rigidbodyinterface

mass of rigidbody

i have this wall of cubes, like a hundred of them, and their rigidbody mass is all 1. I want to make it all 0.01. Is there a way to do that?

Comment
Add comment · Show 2
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 Joshua · Apr 29, 2011 at 12:04 PM 0
Share

Do they all have a common tag or parent or name?

avatar image Muzz 1 · Apr 29, 2011 at 12:06 PM 0
Share

Is this from the detonator framework by some chance?

1 Reply

· Add your reply
  • Sort: 
avatar image
6

Answer by Kourosh · Apr 29, 2011 at 12:17 PM

Make them all children of an empty game object and attach this script to the parent(empty gamobject).

@script ExecuteInEditMode()

var mass:float; //in inspector change this to 0.01 or whatever you want.

function Update(){ for(var child:Transform in transform){ child.gameObject.rigidbody.mass = mass; } }

the moment you type in a new mass value it should automatically change all.

Comment
Add comment · Show 5 · 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 Joshua · Apr 29, 2011 at 12:42 PM 0
Share

Whow, thank you VERY much. I've never gotten around to learning how to script for the editor/extending the editor etcetera, but this is so easy and practical I'm sure I'll be using it extremely often! :-)

avatar image HHameline · Apr 29, 2011 at 01:09 PM 0
Share

Scripting your gameObject changes tends to be incredibly useful with large amounts of objects

avatar image Nevellin · Apr 29, 2011 at 01:46 PM 0
Share

You dont know how good was your help. Thank you very much.

avatar image Kourosh · Apr 29, 2011 at 01:53 PM 0
Share

I'm really glad that it was helpful to you ;)

avatar image almo · Apr 29, 2011 at 03:23 PM 1
Share

2 things to remember: remove this script before publishing, and click the check mark to give $$anonymous$$ourosh credit for the answer. :)

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

No one has followed this question yet.

Related Questions

A node in a childnode? 1 Answer

Collision problems 0 Answers

2D rigidbody movement & walls 2 Answers

Physics not working properly 1 Answer

How would I make an object disappear after a set amount of time? 3 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