0
\$\begingroup\$

I need to make a 3D colliders in Unity with those forms. I don't want to use any Asset Store asset if it's possible. There are two models: both are cylinders but they have some deformations (see image below).

I need to make a collider of both cylinders but it needs to be accurate (I mean, the holes mustn't be in the collisions). As I said, I don't want to use any thing Asset Store if it's possible. So it have to ve with primitive shapes or with mesh colliders, that I can't get them to work propertly with my meshes.

Thanks.

\$\endgroup\$
4
  • \$\begingroup\$ What role do these shapes serve in your gameplay? Depending on what these things need to do, different collision strategies may be more or less appropriate. \$\endgroup\$
    – DMGregory
    Jul 11 at 16:25
  • \$\begingroup\$ Those objects are the obstacles, that make you loose if you crash into them. \$\endgroup\$
    – GospelBG
    Jul 11 at 16:29
  • \$\begingroup\$ And do you need to bounce off the edges, or bounce or roll these objects, or does detecting overlap suffice? What do they look like along the depth axis? \$\endgroup\$
    – DMGregory
    Jul 11 at 16:50
  • \$\begingroup\$ Detecting an overlap is sufficient, but remember that the ball should pass trought the object's holes. I edited the question so now you can see the objects along the depth axis. \$\endgroup\$
    – GospelBG
    Jul 11 at 17:06
1
\$\begingroup\$

For shapes like this, I tend to use a series of box colliders. It may be easier to make a child box object that you can rotate and scale in to position, and then disable the rendering on these objects once you are happy with their placement.

You'll want to trace the outline with these boxes. The less boxes you can use the better. Look at the faces along the edge of your model and get as close as possible to the edges. Depending on your needs, you may not need to be 100% accurate with this.

\$\endgroup\$
1
  • \$\begingroup\$ Exactly what I wanted. Thank you so much. \$\endgroup\$
    – GospelBG
    Jul 13 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.