• 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 /
  • Help Room /
avatar image
0
Question by mephistonight · Jan 06, 2017 at 01:02 AM · rigidbodyvrmesh colliderprecisionconvex

Practical examples of mesh collider work arounds?

I'm new to Unity. I have read through documentation and forums but haven't found a precise answer to my scenario below so please be kind!

I'm making a VR game with objects players need to be able to interact with in a precise (down to the millimeter) way. For a player to be able to pick up and interact with objects they need to have rigid bodies and colliders (interaction script requires it). I can't use basic colliders as the player requires the objects to collide with each other in very price ways. Imagine a cylinder facing vertically upwards and a torus being placed over the cylinder very carefully so that the cylinder only just fits in the torus' central hole without touching the sides. Convex is therefore not possible.

Obviously I can use multiple basic shaped colliders but I'd need so many of them to create an accurate shape of the inside of the torus that I suspect performance would be too poor, especially for a VR game.

My question on the above scenario is, am I missing something obvious? Are people really making tons of basic collider shapes for animated characters, or a space ship flying through a tight space between a hole in an asteroid? Can anyone provide practical examples of how they have solved this problem without a labour intensive workflow? There are so many examples where one would need precise collisions on objects I feel I must be missing something stupidly obvious?

Many thanks for your help in advance. I've tried to solve this myself but have hit a brick wall.

Regards, Paul

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by mephistonight · Jan 11, 2017 at 04:27 PM

In case anyone else stumbles across this question and wants to know the answer.. here is the best I could come up with myself.

The short answer is, yes you do have to manually add lots of primitive colliders when you're looking for precise collisions on a complex mesh. However, compound colliders are a reasonable solution for me at least (link to the manual Rigid body). Ignoring the labour intensive manual work-flow, it's worth keeping in mind that compound colliders make multiple primitive colliders less of a problem for performance... certainly less of a problem than lifting the 250 vert mesh collider limit would have if Unity allowed it.

After creating a torus and manually rotating and transforming lots (95) box colliders so the torus' faces were all covered, collisions are spot on. Though I had to double this number so I could have one set of colliders as triggers (playing an audio clip) and then a second set as non-trigger colliders so that the parent torus collides physically, rather than passing through other game objects. This is because I only wanted to play the audio if a particular gameobject tag was colliding, trigger colliders don't physically collide and OnCollisionEnter is passed the Collision class and not a Collider. i.e I couldn't see a way to find out the object tag of the object colliding with the torus through OnCollisionEnter. This may be me needing to brush up on C# though.

In any case, it ended up being a lot of colliders needed for one game object! I couldn't find any change in frame-rate though, so I stopped worrying about performance.

This discussion on collider issues is also worth reading.

For anyone else making VR games and wanting to speed up the work-flow, I'd recommend keeping an eye on the Unity 5.6 beta. The VR editor looks awesome.

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.

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

119 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 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

Imported Model with Generated Colliders (Convex) problems 1 Answer

Rigidbody - Why does my issue get fixed by doing THIS? 0 Answers

Add Torque goes bad when "Convex" is checked in Mesh Collider 0 Answers

How to extend MeshCollider to cover full mesh,How to make mesh collider extend to cover the whole mesh. 0 Answers

Character hangs on the end of colliders? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges