• 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 kraemer88 · Mar 05, 2011 at 12:14 PM · collidersphere

How to make a sphere fall from a cube when more than 50% of the sphere is outside the cube

I have a sphere that is moving on a cube. But when i reach the cube edges, it doesn't matter that more than 90% of the sphere is outside the cube, the sphere is not falling. How can i make my sphere to fall when >50% it outside the cube?

Image

Imagine that the cube is the roof of a building. So, in IMAGE 2 because of the gravity the ball should fall. In IMAGE 1, after changing the cube's size to X: 0.7, Y: 1, Z: 0.7 the ball is doing what i want it to do, but the visual effect is not very nice, the ball it's falling through the cube's texture.

So, how do i solve this problem?

Comment
Add comment · Show 1
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 Molix · Mar 05, 2011 at 01:00 PM 0
Share

I just did a quick test and it seems to work as expected (new scene, add cube, add sphere, put Rigidbody in sphere, tilt cube a tiny bit to generate roll). Perhaps you could give more info. What you describe sounds like there is a different shape collider in the sphere mesh.

2 Replies

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

Answer by AngryOldMan · Mar 11, 2011 at 05:16 PM

No its not clear because you havn't said what is wrong or right in each picture nor have you explicitly expressed what you want to achieve. I've had to piece together exactly what you want over these lengthy posts which has proved impossible. Did you try what i suggested in the previous post? are you adjusting the collider size and not the actual size of the cube? all i can gather is that you want a ball to roll off a cube. I don't understand what the problem is?

I suggest start again, create a cube, adjust the scale of the cube in it's transform NOT the collider size in the collider component!!! Then create a sphere and add a rigidbody. I have just done it myself now and the physics are fine.

I suggest when asking a question make sure you clearly explain what you want to achieve, how you have tried to achieve it (what exactly you have done), and what precisely it's going wrong (and possibly why if you can figure that out)

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 kraemer88 · Mar 15, 2011 at 12:53 PM 0
Share

Sorry for the delay, i've been out of town for a while. I've tried again as you said, new cube, new sphere etc etc, but the result is the same. Can you please upload somewhere what you've done because i simply cannot accomplish that. Thanks.

avatar image AngryOldMan · Mar 15, 2011 at 01:45 PM 0
Share

Open new scene. Go to GameObject ~> Create Other ~> Cube. Resize the cube's scale under the transform component to x,10 y,1 z,10. Rotate on any axis by 5 degrees. Then go to GameObject ~> Create Other ~> Sphere. With the sphere selected go to Component ~> Physics ~> Rigidbody. $$anonymous$$ake sure the sphere is completely outside and above of the cube (put it in the center) Then press play. The ball will drop onto the cube, roll in whatever direction you have tilted the cube then fall off when it reaches the edge. I think you should look at some basic tutorials if you're having trouble with this task.

avatar image kraemer88 · Mar 16, 2011 at 07:16 PM 0
Share

Of course that works, but after you add a CharacterController and attach a script what you've said it no longer applies. I thought that is obviously that my sphere is controlled by me when i said this: "I havve a sphere that is moving on a cube"

avatar image AngryOldMan · Mar 16, 2011 at 07:54 PM 0
Share

How does "I have a sphere that's moving on a cube" mean "I have a sphere that I control as a player"? This is what I mean by being specific. I've no time to give you a lesson in english just to understand your questions especially when you're one of these people who doesn't mark off answers. The problem you're having is with the size a specification of your character controller's collider http://unity3d.com/support/documentation/Components/class-CharacterController.html if you had made sense in your 1st post you could have had this fixed by now!

avatar image kraemer88 · Mar 16, 2011 at 08:33 PM 0
Share

I thought i was clear, my bad. This will do, i should have read that before, thanks.

avatar image
0

Answer by AngryOldMan · Mar 05, 2011 at 02:34 PM

reduce the size of the collision box on the cube so that the sphere appears to be inside the cube but is still actually rolling across the collider and therefor isn't actually inside.

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 kraemer88 · Mar 08, 2011 at 06:21 PM 0
Share

Well, this works, but the sphere will be falling through the cube, not after it reaches it's edge.

avatar image AngryOldMan · Mar 09, 2011 at 03:50 AM 0
Share

sorry explain that again please, with more detail?

avatar image kraemer88 · Mar 09, 2011 at 02:23 PM 0
Share

If i set, let's say the size to 0.5 ins$$anonymous$$d of 1 on the cube collider, then i will have a quarter on my cube sides without collision box. Well, when the sphere reaches gets either on the left or on the right side, it fall through the visible mesh of the cube, but i want to fall down from the cube like is rolling when it's reaching on one of the sides. Hope now i was a bit more clear with i'm trying to do.

avatar image AngryOldMan · Mar 09, 2011 at 03:07 PM 0
Share

erm no not really, your grammar is a bit broken. I think you want to extend your collider so it covers the x and z size but then have it shorter on the top?so if your cube's size is 1,1,1 then your colliders size should be 1,0.9,1.

avatar image kraemer88 · Mar 11, 2011 at 04:45 PM 0
Share

I have updated the post and added a picture. Hope that all is more clearer now.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Sphere, internal collision 1 Answer

How do i get world position of collider if it inside multiple scaled gameobjects? 0 Answers

How to use Sphere colliders to detect the "Player" 1 Answer

What Space Partitioning is used for Sphere Collider Triggers? 1 Answer

Sphere Collider Help 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