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 Team_26 · May 05, 2014 at 04:10 PM · physicsgravitybuilding

Roof of the builiding (physics)

Hi! I've got a question about Unity physics engine. I'm building a builiding from cubes. These cubes have rigidbody with gravity switched on attached to it. Ok, so I'm builiding walls, floor and then it's time to build roof. Ok, but I've got some problems with physics. I see that my roof is falling down. Ok - it's because I've got gravity on. So I switch off the gravity in rigidbody components of these cubes. But now they're behave very unrealistic when the ball is falling them (for example). They're flying like the cosmos stones.

Is it possible that I can paste the roof between walls without switching off the gravity?

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
1

Answer by Jeff-Kesselman · May 05, 2014 at 04:32 PM

You have fundamental contradiction here.

You want physics, but you want things in mid air with nothing holding them up.

Physics doesn't work that way.

HOWEVER there are some things you could try, I would suggest

  1. Turn gravity off to start with.

  2. Attach an OnCollisionEnter script that turns gravity on when an object collides with the block.

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 AlucardJay · May 06, 2014 at 12:12 AM 0
Share

They're flying like the cosmos stones : set is$$anonymous$$inematic to true

avatar image Jeff-Kesselman · May 06, 2014 at 12:55 AM 0
Share

I am afraid i don'y knwo what a cosmos stone is.

If you set is$$anonymous$$inematic to true than no forces will effect them at all. Thats kind of the brute force way to stop gravity from effecting them.

It would be better to leave them reacting to physics but with rigid body.useGravity=false so they will still respond to being hit.

Then, all you need to do is set it to true when there is a collision to make gravity effect it again.

avatar image AlucardJay · May 06, 2014 at 03:55 AM 0
Share

Sorry, my misunderstanding. I assumed the roof pieces were floating away at start when the building pieces settled. Of course your solution is probably the best, upvoted.

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

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make telephone wires 1 Answer

Edit this script so that on the second jump change the gravity to 5 2 Answers

How can I make a game object move in parabolic motion as if it were under gravity? 2 Answers

Change direction of gravity for a specific instance of a prefab 1 Answer

Setting a jump force on a rigidbody 1 Answer


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