I'm trying to develop a rogue-like game in unity. Because of this, I need a tile-based map.
Thanks to this tutorial, I've created a 9x9 square tiled map easily.
http://classes.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/BoardGameTutorialPart31.pdf
For "too long, didn't read" guys, I basically did those steps;
I draw a 2D 9x9 square tile based map with Adobe Illustrator and saved it as Illustrator 8 file.
I imported that AI file to Autodesk Maya and used Mesh->Seperate tool on it. After that, I unparented all of the tiles and ta-da I've created a 3D tile based map.
I exported .FBX file to my unity projects Assets folder
I draged .FBX file from my Assets folder and dropped to my scene. Done.
Now, my problem is, I want to apply a texture on a single tile. Nevertheless, whenever I try to apply a texture to any tile, it behaves like I'm only taking 1 / 81 of the texture (remember, it's a 9x9 map) and applied only that part of the texture to the related tile.
I'm uploading a screenshot for a better understanding.
I've googled my problem and according to my findings, it's happening because I didn't do any UV Mapping. Well, the thing is I have no idea how to do it (this is going to be my first game and I'm a super-duper newbie to 3D modelling). Only examples on the web are about general UV Mapping (how to map a cube or some other generic shapes) I have no idea about how to do UV mapping to a tile based map with Maya.
Actually, even I don't know it's an UV mapping problem or not. I'm so stucked. Please help me.
Thanks in advance!
I solved my problem.
I just set X = 9 and Y = 9 under the Tile attribute for every tile. Now it looks perfect!
Thank you anyway!
Related
so I spend hours googling and "trial and error"ing, but I still could not figure this out.
I have (half) a chessboard modeled in Blender. I bake all my materials to a single png with UV mapping. It looks like this:
I export the model as an .fbx and the baked texture as a .png. Both are imported to unity.
My goal is to have a single texture/material for the model.
The problem is, that unity still recognizes all squares etc. as separate objects with their own standard UV. When I map the combined texture to the model it is all messed up.
I can see why this happens, but not how to change the mapping so it picks out the right pixels of the texture. Is there something I can do to fix this?
Here is a picture of the model in unity.
Thanks in advance.
I finally found a work around which works perfect. You can merge objects in Blender. The steps I took:
merge all squares and other objects into one. I used this site as a tutorial
create a new uv map for this combined object
bake the textures to the new uv map
export model as .fbx
export texture as .png
import all to unity
create material from texture
apply material to model
Works perfectly fine for me :D
i imported my blender backrooms model to unity, and i got a wierd mess, this is the model in unity , when its in blender it looks exactly as intended, and even when i render a image of the model in blender all the textures look like they should,this is the model in blender, not a rendered image, ive browsed countless "solutions" and i cant find one that applies to mine, i have tried changing unity import settings, extracting both materials and images, and so on, nothing makes the materials look proper, my guess is that its not accounting for UV mapping junk so its stretching the image so far that it becomes blurred beyond recognitiion, if anybody can help me out it would be much appreciated, also just a side note but i dont think the displacement maps work in unity like they do in blender
edit: the model has multiple objects, the floor ceiling and walls are all 3 seperate objects
edit again: here is the node layout for the floor, every other node layout for the walls and ceiling is just the floors layout but without a displacement map on it
It's been a minute since I've used Unity. But without looking at the blender file, I would suspect that it could maybe be that there's two UVs on your model, and Unity is using the wrong one. I believe Unity uses the first UV Map for texture info, while the others are used for lightmap info. If that's the case, just delete the wrong one in your model. Hopefully that helps!
Edit (more info): I created a basic model with walls, ceiling, and floor. The walls, and ceiling only have a UV Map called UVMap. However, the floor has two UV Maps: UVMap and UVMap.001. Like so:
Now, if I click on that little camera icon next to the UVMap/UVMap.001 you will possibly see the overall size of the bricks change. If so, delete the wrongly scaled UV Map so you only have one UV Map in that window. After that, I would just ensure all your UV Maps are called the same on your other meshes, which is typically UVMap as default. You will also want to be sure all of your images are being mapped by UV, not Object or Generated as Unity cannot use that information. From there you should be good to go!
I produced a hightmap from a digital land model and placed it as a terrain into unity. How can I put an arial photograph on it?
Any hints are welcome!
Andreas
You can do this by using the terrain splatmap, in Unity i think it is called alphamap.
Doc available here: https://docs.unity3d.com/ScriptReference/TerrainData.html
Please note that one splatmap can only store 4 textures, so if your arial photograph contains more then 4 different texture types you will need to think in arrays of splatmaps.
If this method does not fit your needs then you need a projector or decal method, read about them.
Alternative way:
If you dont need any runtime magic, you can just add a texture, to your terrain, this texture will be your arial map, and basically fit this onto your terrain. But one texture on large terrains would produce quite bad results imo.
You can do this by generating a mesh procedurally, and setting the UVs according to the size of the image file.
Look up "procedural mesh UV unity"
I want to create a 2d game with tiles that are interactable, i.e farmland, trees, breakable rocks, etc.
Now if I create my tilemap in Tiled which I have done so far, it does not offer that type of control.
I found some posts on how to deal with this but they are at least 3 years old, so wondering if there is some updated answer? maybe something built in to Unity or a plugin I'm not aware of to help create Tilemaps inside Unity?
I want, for example, 1 tile of grass to be able to react if I hit it with a hoe, or water, and change to dirt. Is my only option to create prefabs and place every tile as its own gameobject? won't that kill performance in a large world?
You could try exporting your Tiled tilemap to .tmx format, creating a script in Unity that loads .tmx files for your map and reads every single tile in a for loop.
You would need to assign a prefab to each tile ID of your tilemap, and in that prefab you could have your script with logic attached (grass reacting to a hoe/water) and graphics.
Other idea is to export one big image of your map, and then export .tmx format in the same way as explained before but create game objects only for ID's that player can interact with and only attach scripts to them.
For learning purposes, I'm trying to make a 3d version out of Arkanoid, and it's basically like the pic below. Unfortunately, I'm stuck with the different bat shapes.
The way we did it in 2D was simple:
Make a different picture in Gimp
edit the polygon collider2D so that it fits
But since it's a 3D remade version I'm doing, I have to get some special 3D models, which are meant to:
the surface facing the screen should have interesting shapes
Every point of the sides should be a straight line towards the bottom.
What is the best way to get it?
Online assets? If so , can you show me some search key words to search for it?
Learn Maya? Is it hard to learn?
(^^(*&())
Game screenshot
There are just too many websites for online purchase of unity assets. So you need to search for yourself. here are the keywords which work best for unity assets:
For 2D assets: Sprite | Transparent PNG
For 2D animations: Spritesheet
For 3D assets: 3D Model | 3D Unity Asset
For 3D animated models: 3D Model With Unity Animation | 3D Model With mecanim
This link has many websites:
http://answers.unity3d.com/questions/16650/game-asset-website-list-free-and-paid-textures-mod.html
This asset provides many animations:
https://www.assetstore.unity3d.com/en/#!/content/6444
Sometimes searching for a complete project or a full pack is a good idea. E.g. Animals Pack Unity or Unity Military Pack