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 dovedevic · Nov 02, 2013 at 03:05 AM · cameraphysicscuberealisticcorner

How would I go about making a cube "tumble" off of corners and such?

Title says it all. I have a simple cube on a desk. I would like it when i move the cube (Trough keys atm) it falls, but not directly downward, but tumbles around and when it hits the ground it tumbles more until it steadies. All the while the camera is steadied. IE, its not tumbling as well. Any way of attacking this feat? Any help would be great!

--Dove Devic

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 Freaking-Pingo · Nov 02, 2013 at 11:52 AM

From my understanding it sound like you want physics implemented into your game. Add a rigidbody to your cube and use .AddForce() for handling movement. The physics in the rigidbody will make sure your cube falls of the table.

You should properly dwell into the physics system a bit in order to understand what you are actually doing and therefore I have linked a few resources for you.

Unity's page about its physics

Information about rigidbody

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
avatar image
0

Answer by Owen-Reynolds · Nov 02, 2013 at 04:34 PM

Assuming you are using a rigidbody, but it looks kind of boring when it falls:

o A physics material can give it more bounce, or change friction (sometimes giving it more friction will make it tip over and roll more, instead of sliding.)

o Changing the collider can make it roll more. Could make your own cube mesh but with rounded corners (if you don't know how to model, this will be too much trouble, unless you can find one premade.) Or, easier to do but harder to explain, you could shrink the box a little and add a capsule collider (child) along each edge. That will make them count as rounded.

o Can give the cube a script with OnCollisionEnter. Say something like "if it's going fast enough, give it a fun twist and bounce." Ex:

 if(rigidbody.velocity.magnitude>2.0f) { // going fast enough
   // sample twist (other ways to do it, but this does work):
   rigidbody.angularVelocity += new Vector3(Random.Range(-2.0f, 2.0f),0,0));
   // sample jiggle:
   rigidbody.velocity += new Vector3(Random.Range(-0.5f, 0.5f), 0, 0);
 }

This can take a lot of tweaking to make it not just bounce around like popcorn.

o Put some invisible, small colliders where it will land. Say you add a long flat tilted (invisible) cube. If it's close enough to the ground, no one will notice you're hitting something invisible. And it will pop your cube a little bit sideways. Adding some more small "point up" invisible cubes will twist your cube when it hits them off-center.

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

17 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

Related Questions

Make a rolling ball always on ground without falling when reaching the edges of the map 1 Answer

All Sprites Instantiate In top right of screen for some reason. 0 Answers

Freezing movement on Z axis. 1 Answer

simple thing I can't get right (see picture) 0 Answers

Jumpy object movement and camera movement 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