Jump to content

Unity Mesh Collision Problems


Recommended Posts

Hi, I'm making a mod for KSP, and am having mesh collision problems. I use Unity. To make the mesh, I use capsule collider, because I have too many vertices for mesh collider. Because I use capsule collider, my mesh rounds off at the bottom and top, so when I try to attach stuff to the sides at the bottom or top, they end up inside the tank. Can anyone help? :(

Link to comment
Share on other sites

Make a low-poly mesh collider!
What kind of part are you making? For a cylindrical tank it's best to create a 12-sided cylinder and use that as the mesh collider. It can even be on a seperate gameobject (as long as it's inside the part hierarchy). Just import the collision mesh and remove its mesh renderer, then add a mesh collider component. Make sure 'is convex' is ticked.
 

Link to comment
Share on other sites

2 hours ago, Porkjet said:

Make a low-poly mesh collider!
What kind of part are you making? For a cylindrical tank it's best to create a 12-sided cylinder and use that as the mesh collider. It can even be on a seperate gameobject (as long as it's inside the part hierarchy). Just import the collision mesh and remove its mesh renderer, then add a mesh collider component. Make sure 'is convex' is ticked.

I read once that you can combine colliders that allow surface attachment and collider that do not in the same object, but I cannot remember how. Do you happen to know?

Link to comment
Share on other sites

5 hours ago, Porkjet said:

Make a low-poly mesh collider!
What kind of part are you making? For a cylindrical tank it's best to create a 12-sided cylinder and use that as the mesh collider. It can even be on a seperate gameobject (as long as it's inside the part hierarchy). Just import the collision mesh and remove its mesh renderer, then add a mesh collider component. Make sure 'is convex' is ticked.
 

I'm making a cylindrical fuel tank. How do you make a low-poly mesh collider?

Link to comment
Share on other sites

6 hours ago, Porkjet said:
24 minutes ago, Battledamaged10 said:

I'm making a cylindrical fuel tank. How do you make a low-poly mesh collider?

Make a low-poly mesh collider!
What kind of part are you making? For a cylindrical tank it's best to create a 12-sided cylinder and use that as the mesh collider. It can even be on a seperate gameobject (as long as it's inside the part hierarchy). Just import the collision mesh and remove its mesh renderer, then add a mesh collider component. Make sure 'is convex' is ticked.
 

Never mind. I figured it out. Thanks for suggesting that! It really helped! :D

Link to comment
Share on other sites

24 minutes ago, Battledamaged10 said:

I'm making a cylindrical fuel tank. How do you make a low-poly mesh collider?

Just create a sphere with many fewer segments than the fuel tank, align with the main object and make it a child of the main object, export to unity,  add convex mesh collider to the sphere then remove the mesh renderer and mesh filter, you should be left with a low poly collider on a higher poly object

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...