Daniel Halfoni
Daniel Halfoni

Reputation: 507

How can I export a cylinder from Blender to Unity 3D to be like a Unity 3D cylinder?

In Unity 3D I make GameObject3D Object → *Cylinder. And this cylinder has the components: Cylinder (Mesh Filter), Capsule Collider, and Mesh Renderer. I can add the last two components to my exported cylinder from Blender, but I can't add the Cylinder (Mesh Filter) component. What is Cylinder (Mesh Filter)? Is it just a Mesh Filter component?

Now I have some problems. I created some Cylinders in Blender. All of them I did using Knife Project. And the last step was to click on DeleteFaces. If I'm not clicking on Delete and make delete faces, it will not cut the hole.

The first problem is in the first cylinder I created in Blender. I cut a simple circle hole, and it's working fine exported it to Unity 3D. But the next cylinders I exported for some reason, when I'm looking at them from the front, are hollow. I see the other side outside, but if I'm moving around from the back, it's not hollow. I am not sure why.

In this screenshot are the cylinders I exported and they are in Unity 3D. The one that is fine is on the left. The others on the right hollow like. The hole cut was to the other side, but if I will look from behind, it's not open in the back:

Front

Back:

Back

The cylinders on the right I changed the circle. The one on the left I didn't change; it only rotated it.

My main goal in the end is to create a cylinder in Blender with just a hole I can walk inside with my character in Unity 3D.

The on the left seems fine, but the hole is too small and high, so I can't walk in.

In Blender it looks fine only in Unity. It looks hollow side to side from the front:

Cylinder blender

Upvotes: 0

Views: 853

Answers (2)

Hristo
Hristo

Reputation: 1815

You simply need to flip your Normals in Blender. That is the reason you are seeing this effect in the whole of your cylinder. Follow this tutorial for the inside faces of your cylinder.

Upvotes: 0

Emre Bener
Emre Bener

Reputation: 1462

The problem is not the normals.

Unity does not render backfaces. Faces have front and back sides, and game engines don't render back sides by default for optimization reasons. Your mesh is not watertight, and from the hole you are seeing the back side of the faces of the other side.

The first cylinder looks fine, because it has volume, so it's watertight and its backfaces are hidden inside it.

Solution 1: in Unity, set the cylinder's material as double-sided. This will tell Unity to not disregard backfaces that use this material.

Solution 2: in Blender, extrude all faces of the cylinder a bit so that it has some volume to it. This way, the mesh will be watertight, so there will be no backfaces visible (backfaces will be hidden inside the model).

Regarding collision problems;

if you want a character to be able to walk inside the cylinder, but not through its walls, do solution 2 and put a "mesh collider component" on the cylinder in Unity. This will make each face collideable instead of wrapping a simple 3D object around the model as the collider.

Upvotes: 0

Related Questions