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 JPB18 · Jul 31, 2012 at 03:06 PM · physicsspacecollisionsasteroid

Collision and physics: asteroid

Hi there!

So, I'm now programing the collision system for my game, and when my ship hits a asteroid two things happen:

  1. I loose control of my ship;

  2. The asteroid goes flying to a place very far away;

First how can I prevent the loss of control of my ship, and second, how can I prevent the asteroid from going to "a place very far away", and instead just divert slightly its course?

The ship has a rigidbody with a mass of 1, and a capsule collider, while the asteroid (a cube, at this moment) has a rigidbody with a mass of 0.5 and a cube collider. Both rigidbodies are affected by gravity (which is 0 in this scene). At this moment the only scripts I've is the one to control the ship, the camera script, and nothing more.

So, how can I fix this?

Thanks in advance.

João Borrego

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
0
Best Answer

Answer by Sirithang · Jul 31, 2012 at 03:20 PM

Well maybe try to change the mass no? :D

As the doc say for Rigidbody.mass, try not to go above 10, and it's more of a "relative" scale : higher value will move less when hiting lower value and vice versa. So why not try something like 1 for the ship and 2 or more for the asteroid?

For the loss of control, well you can try to play with the Rigidbody.angularDrag, as the doc says "the higher it is, the fastest the rotation will stop". Same thing apply to the "drag", that affect the linear velocity (how fast will the mobile come to a top when moving).

You can also try to play with the Physic Material, changing the bouciness or else...

Comment
Add comment · Show 1 · 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 JPB18 · Jul 31, 2012 at 03:30 PM 0
Share

I guess those tips worked, and are going to be useful in the future! Thanks!

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

7 People are following this question.

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

Related Questions

How to make first-person work in zero-G with planets? 1 Answer

Inconsistent Trigger events 1 Answer

How to Buffet an object floating in space? 1 Answer

Complex Object Out of Control Collisions 1 Answer

How do I detect current collisions without using onCollisionEnter? 0 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