I am currently using Unity 5 to setup a small game so that I can see the assets I recently made in blender in action.
I have created a uv-map in blender and added the necessary colour (it works and displays nicely and blender) but it doesn't seem to work in Unity. What I've done is created a material, chosen the uv (under the albedo option) and then applied it in the skinned-mesh renderer of the object but it colours the entire object only one of the colours included or it just doesn't colour at all. I tried messing with the import options (swapping the UV's) but it doesn't seem to work.
Any help would be greatly appreciated.
Is there a chance you've been tricked by the annoying new button in Unity's "new" shader,
To change the :actual texture", it's called Albedo which is annoying.
You must click precisely the little "dot" shown below!
The "little dot" is between the small square, and the word "Albedo".
Then, a selector panel appears. HOWEVER there is a soft bug: When the selector panel appears it immediately goes to the back of all windows.
Many people, certainly myself, get fooled by this. It's quite annoying.
So, hopefully the problem is just that you have not yet selected the texture to display, considering the "tricky button issue" on Unity's "new" universal shader.
Related
I've been working on a fairly large project in Unity. Until recently, we weren't using universal render pipeline (URP) and made that change. When we did, all the bloom effect we already had in place to create a neon glow look for our game disappeared, and everything looks opaque. All the tutorials I found say that it's fairly simple to add this effect, but I can't make it work. I'm starting to get suspicious of the Cinemachine in the main camera, since it's brought us problems in the past. I'll just state some of the things I've tried:
The post processing checkbox is ticked in the camera view.
My materials have emission turned on with colors that used to work before URP.
The camera has the volume component, with an override of bloom and the values of intensity and threshold super high.
I've also dropped a global Volume in the scene with a volume component with bloom effect (one solution suggested I do that)
I think that's everything. Please let me know of any suggestions!
So I modelled a gun model for my game in blender, and after importing it in Unity one of the faces simply disappeared as you can see in the link below :
https://ibb.co/rwPDY8r
I tried flipping the normal on that face in blender, recalculate the normals, and half a dozen of other solution for that problem I found online, but nothing works.
it's weird because it does appear normal in Blender :
https://ibb.co/BVdMGqg
One thing I noticed is that when I open the .fbx file with windows 3D viewer, this anomaly is visible on the hidden face :
https://ibb.co/1ZLxf0D
It is the only face on the model that has that black anomaly, all the others are normal.
I am about to give up and just delete it and start over. So if anyone has a solution I would be very grateful since I already spent a few hours making the gun and a couple more trying to fix this, I would hate to have to redo everything again (Especially since i'm pretty proud of that gun).
Thanks in advance.
Edit: Ok so nothing worked. I tried all the answers here (which I did try before but tried them again just in case) and it's still not working. I Even tried duplicating the face and extruding it a bit, still invisible. I'll scrap this one and make another, this time with backface culling enabled so I can see what I can do. Thanks for your time guys.
You probably have an inverted face in your mesh. Here is how to find that:
You can select it and choose "flip normal" in edit mode. Or just choose "recalculate outside" with all faces selected.
As an alternative to "Face Orientation", you could enable "Backface Culling" which is what Unity does by default (unless you enable the material to be "double sided" or play with the Cull type in shader.)
This will hide the problematic face as you are looking against the backside. Fly inside the mesh and you will see the other side being rendered.
The problem is solved in four simple steps:
Click model on blender
Press Tab to Edit Mode
Press Shift + N to Recalculates Normals.
Save, Export from blender and going to unity again will fix.
When you import .fbx to Unity you can also change the Normals method import to calculate in import settings. Sometimes it helps.
I just started using URP in Unity for a game in progress. I'm doing a sort of sprites-in-3d thing, so I'm rendering some sprite sheets on quads. To do this, I create a Material with the sprite sheet and use tiling/offset to render the proper frame of animation by making a call like:
CombatMaterial?.SetTextureOffset("_BaseMap", new Vector2( (AnimationDefinitions[animationDefinition] % 16) * .0625f, CombatMaterial.mainTextureOffset.y));
I'm currently trying to add some feedback into my game for when characters use abilities or get hit by flickering the material. Because the base color starts at white and goes to black, that won't really work; the only other thing I seem to have available to me is emission, which looks great. Using a 0xAAAish color achieves the effect I'm looking for. I've been using the Feel Unity asset to do this, but I've also attempted using something like this:
CombatMaterial?.SetColor("_EmissionColor", Color.white);
The problem is, once I've set the _EmissionColor, the main texture offset no longer updates in game, thereby ruining all animations. If I change the texture offset manually through the inspector at runtime, animations don't work AND the _EmissionColor flickering stop working. If I mess around with the color of the _BaseMap in the inspector, _EmissionColor flickering starts working again.
Before I start diving into some unsightly color adjustments in an attempt to make this work again, I would love to know if I'm doing something that is simply unsupported by URP/Materials/whatever, or if there is some alternative to what I'm doing that's a little more straightforward.
Thank you!
After trying a bunch of random stuff, I don't have a "real" solution, but the game IS working how I want it to.
What worked for me was setting the _EmissionColor on the Material to (1,1,1). For some reason, when the _EmissionColor is set to (0,0,0) it's a black (ha) hole and won't accept future changes to the _EmissionColor. I assume this is some shader nonsense (with the base Lit Shader that URP uses) that I am clearly unfamiliar with.
Hopefully this helps anyone doing something as pointlessly against the grain as I am!
I've decided to use Minecraft like characters in my small game since I do not know how to make 3d models (nor I want to learn how to do such thing in the near future).
However the task now seem a little harder than expected:
I've tried looking in the asset store for prefabs to use but without success.
So, I've decided to try and make a model on blender(by not knowing a thing about non parametric 3d modeling, my knowledge of blender is extremely limited) and import it into my unity game.
And surprisingly, I managed to create the model using McPrep, export it and import it into unity maintaining objects that drive the bones (the output is a bit messy but I think I can manage to clean it up a little).
However the imported version does not have any skin and appears in a gray shade.
Turns out that the output does not keep materials/textures with it!
I've tried getting the texture used by blender and it returns the same skin I fed into mcprep so, by using the same skin, I've tried creating a material with it by getting the .png and using it as texture in a unlit texture material.
However, the result is a bit messy as shown here (left is Blender, right is Unity):
How may I make the texture on unity3d be better and right? (I've heard there is a way using a C# script but I really don't know what it is nor how to do it)
EDIT:
Thanks for the answers before, I did set the filter to point obtaining the texture to be a bit better. However the part that should be transparent is displayed in black on top of the other part (I think).
The image on the right is only filter point and the one on the left is point + alpha is transparency and the transparent shader using unlit transparent
ANSWER FOUND:
As Bart said, make sure the textures' Filter Mode is set to Point, but additionally:
Minecraft player characters are made of 2 layers, the second layer usually has lots of transparency and is used for clothing or other relief detail. So you need to use a transparency-capable shader on your material in Unity.
You're running into a filtering issue. In your case you want no filtering to happen. So select your texture, and in the inspector change the import settings so that your "Filter Mode" is set to "Point". In this case it will do no filtering of the input and your large pixels should appear sharp as you want.
I've finally decided to start Unity. I have little to none experience with these kinds of stuff, and I'm currently facing a problem. When I import a 3d shape on unity, the default color is beige, even though it is set to white. When I try making a white texture and apply it to the object, it still turns out as beige.
This is due to lighting. Check the light source in your scene, it probably has a yellow-ish color, try to turn that back to white.
Depending on your render pipeline (Universal RP, HDRP...) you might even have something like global illumination with a slight color tint enabled. Try to check your lighting settings.
You can also always click on the material the object in question uses and in the little preview window you see it lit by a neutral light source, without your scene lighting settings.
also, you did not provide an image, which is why I can only help you so far given your message :)