• 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
1
Question by gamerant · Aug 27, 2013 at 08:25 PM · physicscollider

Why does the sphere collider pass through mesh collider at a certain point?

Hi there,

The question is as it stands but let me explain.I have a ball with a sphere collider and a platform with slants and turns with a mesh collider. Both have rigid bodies attached to them.

When you play, the ball rolls on the platform and stays on it which is the aim.However there is a certain point on the platform where the sphere just goes right through it and starts falling.

I have rebuilt the scene from scratch and created an empty game object with a collider attached that was just under the location where the ball seems to go through the floor,but non of this worked.And this has me confused as to how to fix it.All my other levels work fine and don't have this issue except for this one.

So what I'm asking is what is the reason for the ball to pass through the platform(floor) only at a certain point in the level,but work correctly by staying on the platform across the rest of this level.

All advice is welcome :D By the way I have asked this on the forums,but have recieved no reply so far.

Comment
Add comment · Show 4
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 getyour411 · Aug 27, 2013 at 08:35 PM 0
Share

Are you using transform.position to move the ball?

avatar image gamerant · Aug 27, 2013 at 08:40 PM 0
Share

Nope.I guess I should of made this clear at the start :D I'm moving the platform by rotating it and the ball just rolls in the direction that the platform has rotated.

avatar image neonblitzer · Aug 27, 2013 at 08:50 PM 0
Share

Do you use Transform methods for rotating the platform? If you do, you should use Rigidbody methods ins$$anonymous$$d, such as $$anonymous$$oveRotation().

avatar image gamerant · Aug 27, 2013 at 08:56 PM 0
Share

Yup all are Transform methods.And I'm not yet familiar with the Rigidbody method so do you have any links that would let me read about it?

1 Reply

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

Answer by neonblitzer · Aug 27, 2013 at 09:22 PM

Ok, I'll post this as an answer. Check out these articles in Unity Documentation:

  • AddTorque adds an amount of force to rotate an object. Nice if the movement should be smooth and continuous, and "physics-like".

  • MoveRotation sets the rotation directly but still calculates the physics correctly. Easy to use, allows sharp movements.

EDIT: All physics-related calculations should be inside FixedUpdate(), not Update(). FixedUpdate() @ Unity Docs

EDIT2: If the platform's movement is directly controlled by the player, it should probably be a Kinematic Rigidbody. This means that physics won't affect the kinematic object, but it will affect other rigidbodies.

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 gamerant · Aug 27, 2013 at 10:08 PM 0
Share

Thank you.This has helped.I'll be reading all the links later,but checking is kinematic on the platform's rigid body has fixed the issue.

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

16 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

Related Questions

Physics.Raycast not checking layermask properly? 1 Answer

Is there a way to determine if an object is within a trigger, from objects perspective? 2 Answers

Camera gets flung off of the map when the player collides with certain objects. 0 Answers

Punching a crate 0 Answers

Only take into account colliders' bounds on single gameobject in hierarchy 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