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 Arkhound · May 03, 2015 at 09:21 PM · collidersphereinternalreflect

Sphere, internal collision

I'll preface this by saying I'm a Unity scrub but have decent game programming experience, particularly XNA, GameMaker, and Processing.

I'm working on a game that does something like MonkeyBall where a primary ball is the player except it uses multiple objects in the sphere to determine it's movement.

I'm trying to find a to keep the objects the sphere. I made the meshes in Modo, an internal and external sphere. The internal sphere has the normals flipped to face the center of the sphere.

I tried to use a Mesh Collider but received a "Non-convex MeshColliders with non-kinematic Rigidbodies are no longer supported Unity 5.0." error. I'm not entirely sure what this means. This suggested turning on the convex and trigger fields but that just gave me more errors complaining about the amount of polys my mesh. I'm not sure if I can actually reduce the polys since it is the basic sphere Modo.

Another post I read suggested using the Vector3.Reflect to keep the objects when hitting the outer of the sphere. This be my option but I'm not entirely how I would implement it considering my lack of Unity experience.

I would appreciate any suggestions or pointers.

!

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 Baste · May 03, 2015 at 09:27 PM 0
Share

Seems like your question is a bit borked:

"I'm trying to find a to keep the objects the"

avatar image Arkhound · May 03, 2015 at 09:43 PM 0
Share

Thanks, fixed it. This was late at night, sorry.

avatar image siaran · May 03, 2015 at 10:38 PM 0
Share

"I'm working on a game that does something like $$anonymous$$onkeyBall where a primary is the except it uses multiple objects the to deter$$anonymous$$e it's movement."

That sentence is still messed up...

"a primary is the ..." The what? "it uses multiple objects the to deter$$anonymous$$e ..." another 'the' that doesn't seem to refer to anything...

I'm not familiar with $$anonymous$$onkeyBall, so it's not completely clear what you want. But it sounds like you want an 'inverted sphere collider'?

Hmm, I don't actually know at what point the OnCollisionEnter() and OnCollisionExit() methods get called if the object comes from inside the collider (if they get called at all), but those methods would be my first idea to use. Just invert the forces on colliding objects just after a collision (if those methods get called).

Otherwise, you may have to write your own collision check.

avatar image Arkhound · May 03, 2015 at 10:56 PM 0
Share

Yeah, sorry, it looks like random words got cut out. I'm now actually unsure if it was my fault. Anyhow, I took a quick look over and fixed what I saw.

$$anonymous$$onkeyball essentially has a character that rolls around in a ball. Think sonic but never running, always rolling.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Baste · May 03, 2015 at 10:41 PM

The issue with non-convex colliders with rigidbodies is a drawback to the physics engine. You only really run into it when you're trying to do things that essentially boild down to "hamster wheels" - all physics objects needs to be convex - which means that there has to be a closed surface in every outward direction.

I think that the best solution would be to not use physics on whatever's inside the ball. Put an animated character there, and play running animations, but instead of moving that character and having physics make the ball roll, just roll the ball by using rigidbody.AddForceAtPoint at some appropriate point along the sphere.. Not only will that fix your problem, it'll probably be a lot easier to tune than having things work with a character inside.

Edit: you should also experiment with AddTorque or AddRelativeTorque, depending on your need. Keep the model in the center of the ball in place by setting it as a child of the ball, and then setting it's local rotation to the correct value every frame.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Material Sphere Green 1 Answer

Increase the radius of Unity's primitive sphere? 1 Answer

How to set a boundary around an object? 1 Answer

Newbie starting out bit stuck :( 1 Answer

overlap half sphere? 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