Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 AyeEmTeeBee · Mar 04, 2018 at 04:35 AM · collidersphereflipspherecolliderinvert

Invert sphere collider

I plan for the player walk from the inside of a sphere. I can't find out how to do it, and from what I've checked, other related topics don't have a clear answer on how to do this.

This is a sphere collider I'm trying to invert, so trying to make multiple planes to form the shape of a sphere won't do.

Comment
Add comment · Show 2
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 hexagonius · Mar 04, 2018 at 06:56 AM 0
Share

Not possible without access to the sourcecode of Unity. A sphere collider is nothing more than a test for the radius to a point. If less, then push out. That's it.
If you want to invert that you'd need to write your own special Physics for that case. Do not use a sphere collider but do the calculations necessary yourself and apply them in FixedUpdate.

avatar image meat5000 ♦ · Mar 04, 2018 at 09:37 AM 1
Share

This used to be possible with Convex mesh colliders but its not longer supported unless rigidbody is kinematic. I tried taking a slice out of a sphere and making it thick but Unity is no longer able to generate a matching mesh. This is actually disappointing as I had an old game that relied on it.

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Bodhid · Mar 04, 2018 at 11:13 AM

That is unfortunately not possible with how a sphere collider works, it is a distance check to the center. The only thing you can do is have an actual mesh to walk on, or do everything by code yourself.

You can create a (high poly) sphere in 3D modelling software (maya, 3ds max, blender etc.) and reverse the faces. Then use it as an mesh collider (not convex) in your unity scene.

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
1

Answer by AyeEmTeeBee · Mar 04, 2018 at 07:35 PM

I've got the collider working from flipping a sphere in Blender, but the material is not showing. Using base color seems to work fine on it, but using textures does not work.

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 Bodhid · Mar 05, 2018 at 09:21 AM 1
Share

Check the UV's on your model. A sphere usually has an equirectangular texture layout. It could be that this was lost when you flipped the sphere

avatar image
0

Answer by saml_baker · Mar 04, 2018 at 06:59 AM

One thing that I could think of is like what you said kind of is to create a plane and distort it into a sphere shape or using multiple planes. You also could create a mesh from parametric equations and then use the mesh as the collider for a mesh collider but you should not because it would be incredibly inefficient to do so.

Maybe you could make a flat plane that the Player stands on that is at the same level as the sphere floor instead of making a large collider for the entire sphere. Using this method, if it is a first person game, you could make the plane and player stationary while the sphere moves around them when the player presses the keys? If it is 3rd person you could make the plane match the position of the player and match the rotation of the sphere? I am not entirely sure but those are my thoughts.

Comment
Add comment · Show 2 · 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 AyeEmTeeBee · Mar 04, 2018 at 07:03 PM 0
Share

I'm not ai$$anonymous$$g for an anti-gravity effect. Gravity should always pull the player down, like trying to run up a bowl. Should I create a mesh in Blender to be used as the collider and a renderer?

avatar image saml_baker AyeEmTeeBee · Mar 06, 2018 at 12:39 AM 0
Share

yes I think that for the affect you are looking for, that is your best option.

avatar image
0

Answer by SibochCZ · Sep 04, 2020 at 06:27 PM

I did it by giving a collider object thickness in Blender. In my case I wanted to create cylindrical collider to collide with objects inside. Just beware of normals, they must be flipped towards the object(s) you want to collide with.

alt text

alt text


blender-object.png (71.6 kB)
unity-collider.png (500.8 kB)
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

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

Related Questions

Find out needed sphere radius to cover a collider 1 Answer

How to keep the orientation of an object unchanged when applying forces on its sphere collider? 1 Answer

CharacterController vs Rigidbody (photo included) 2 Answers

pop up between 2 colliders: bug or not? 1 Answer

How can I disable this collider, when two are present on the gameobject 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