Models in unity from Blender - unity3d

i'm making a tank based game and when i made a model of the tank in blender and imported it to unity. When I placed a camera inside the wall was completely transparent from the inside but not the outside.
Is there any simple fix to this problem?

In blender you have to make sure your normals are facing outward. If you are using planes imported from Unity they will only show up on one side, its better to use cubes if you want them to be visible for both sides. If you are using a plane you can create a custom 'CULL OFF' shader so that backface culling will disable on its material and will show on both sides.

Related

Why SpotLight passes through 3D sprite using this shader?

I'm using Unity2021.3, and this is a URP project.
There is a 3D sprite in the scene that receives and casts shadow, the material for its spriteRender uses a shader that is a simple modification of Unity URP Simple Lit, and there is a spotLight in front of the 3D sprite with shadow enabled, and there is also a directional light in the scene. The 3D sprite casts shadow on the ground due to the directional light and the spotLight, everything is correct.
But if I switch to a new shader, it seems the SpotLight passes through the 3D sprite, rendering the shadow incorrectly, if I move the SpotLight to make it far away from the 3D sprite, then it seems the shadow is correct.
Please see the attached screenshot, the top three screens are custom shader, below two are the URP Simple Lit variant.
I'm wondering what the problem is with the new shader?
Thank you so much.

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

In Unity 3D I make GameObject β†’ 3D 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 Delete β†’ Faces. 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:
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:
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.
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.

unity 5.6.0b7 vr stereoscopic panorama + 3d objects

I have 2 textures to create stereoscopic panorama on VR and i want to make a 360ΒΊ experience. In order to achieve this I need to show one texture at the left side (VR-LeftEye) and the other at the right side (VR-RightEye). Additionally i have to show 3D models in front of the panorama to interact with them.
Im using cardboard GoogleVR v1.20 with Unity 5.6.0b7. I have no problem with changing any version.
After several researches i got few possible solutions but i dont know how to implement them at 100%:
2 spheres (with the faces inside) with 1 camera at the center of the spheres and cull the left on the right side and viceversa. I don know how to cull in different ways per side because only one camera is needed to make stereo in 5.6.
2 textures in the same sphere material and the shader should select the needed texture according to the rendering side. I dont know how to know what is the rendering side in the shader code.
2 spheres, 2 cameras.This is the most artisan way and i have some issues displaying the 3d objects and i got double rotation speed.
Any tips or solutions are welcome.
EDIT:
Im looking for a solution on Unity 5.6.0 because it just implemented a feature that make 2 projections with a distance between them simulating both eyes.
I'm not familiar with VR in unity, but 3rd option sounds better because of the additional 3D models in front of the panorama.
Furthermore, since the eyes are in the center of the spheres in this implementation, moving 3D objects in front of the cameras might be tricky.

How to remove a texture from one side of a cube in Unity 5?

I'm building a visual city in Unity 5 and I used some textures for my buildings. But the problem is whenever I adjust a texture a cube ,it sets all of the sides of the cube to that texture.. I mean I want to remove the roof side texture because there's no building in the real world which has windows on the roof ! As you can see in this image:
So how can I remove texture from the top side ?
Daniel is right. And there is another way to achieve that is add a plane on the top of the cube.
To accomplish this you're going to have to do something called UV mapping.
Short answer is that this isn't possible with a regular cube in Unity, you're either going to have to create your own model, or some code to generate a mesh within Unity
http://answers.unity3d.com/questions/306959/uv-mapping.html
Either you know how to manipulate atlas texture or the simple call is to
Place a quad on top of that face of the cube (you could actually make a new cube of 5 quads or less)
Cut the part of the atlas map
Create a new texture and assign it to a material
Apply that material to the quad.
Then you can swap the texture of that material without affecting other faces.

Make 2D particle system in Unity

SO I saw a tutorial online how to make a particle system, and I made it. Only thing is, I want to use it for a 2D Menu. So when I add the particles in front of the canvas, they don't show up in 2D. How do I make particles that will show up on a 2D menu?
You can try positioning your Canvas in World Space, then moving it behind the particle system. This will allow the Canvas to be positioned like all the other objects in your scene, and no longer be constrained to the camera.
Here's a guide from Unity on how to do it.