How to create a hollow cylinder/tube/pipe/tunnel in Unity?

As part of my project, I need to create a horizontal transparent tube so that the character(ball) can pass through it & come out of it at the end of the game. The input is given through a pressure sensor squeezable ball.

I would like to know if this is possible in Unity or should I do it in other softwares like Blender & import it to Unity?

Please help. Thanks in advance.

2 Answers

2

The typical solutions is the modeling program as suggested by @anurooppv. But you can also take a look at Procedural Primitives from the Wiki page. In addition, there are some inexpensive primitives both in the asset store and elsewhere that have tubes.

But you will also need the second part of your problem…a shader for glass. There are a couple on the Wiki Shader page (search for glass). I’ve never used them specifically, but it is a starting point.

Thanks a lot for the reply. I am new to Unity. Can I create a tube & make a ball travel through it & get updates(may be counting the hits) when it hits the top & bottom of the tube? Is it difficult? Any pointers to such a game will be really helpful. Thanks in advance.

You never know with physics until you try, but as long as you use a SphereCollider on whatever ball you use, it should work fine. There are specific criteria and setup for mesh to mash collisions. For counting, you'll want a separate colliders for the ends of the tube. And you may have to pay attention to the physic material you apply to the colliders.

Unity is not designed for modelling, and does not have the features included to create anything other than the most basic 3d primitives - cubes, spheres etc. I suggest you model your tube in Blender and import it as an FBX asset.

Thanks a lot for the reply