Building a Room w/ Materials

Hi–

So what is a good way to build a room with materials?

For example:

  1. start with cube
  2. resize it to desired size of wall
  3. duplicate reposition that for another wall
  4. stretch it to a different desired size
  5. apply wall material to both
  6. texture tiling is different between them

And I can’t adjust the material tiling for each wall, because that changes the material and thus the tiling for both walls. That’s a problem… Advice?

Use a 3D app.

–Eric

Can you be more specific? What would I need to do? Unity really can’t just auto-tile?

Something like Blender, Maya, Max, etc. Unity isn’t intended for creating 3D assets (aside from the terrain, which is a specialized case).

–Eric

Yeah, I just got Maya, so what would I need to do in there to achieve correctly tiled materials for whatever-sized wall I’d want? Thanks.

You shouldn’t be trying to model inside Unity. Use Unity’s simple primitives when prototyping or creating temporary placeholders.
Model assets in a DCC package and then import them into Unity.

Yeah I’m just prototyping right now, but I was hoping I could prototype with simple wall, floor and ceiling textures instead of just pure gray… just so it’d look a little nicer.

That’s a Maya question. I don’t use it, so I don’t know exactly…probably look into whatever UV mapping features it has.

–Eric

Ok in this case it’s fine, but you are limited by Unity’s editor tools, which are not robust enough for what you are trying to do. When I prototype with Unity, I usually prototype assets like this in a 3d package and then import into Unity, because it’s faster. Technically you can create a prototype of your building in Unity using cubes, but you will have to scale the sides, readjust, etc.
Just thought of something you’re going to like.
You’re problem right now is that when you change the size of the cube via scaling, you need to readjust the position of the cube, this is happening because the pivot point is centered in the middle of the object. In Unity you can’t just move and modify the pivot point, this is where a 3d program comes in useful, because in that environment you can.
In Unity however, you can use a little trick that will work in your case. Here’s what you do:

  1. create a cube
  2. create an empty game object
  3. snap the empty game object (EGO) to one of the lower corners of the cube using vertex snapping, just find a corner that you feel works best for you
  4. now parent the cube to the EGO; i.e. make the EGO the parent of the cube
  5. now scale only the EGO and the cube will scale automatically based on the new pivot point of the EGO, thus allowing you to scale and not have to readjust the position of the cube all the time.

This is just a simple little trick you can use in Unity, but I still strongly advise using a professional 3d application for this.

Interesting… Thanks for the tip.

Well I guess I’ll try rebuilding the prototype rooms in Maya, but is there any way around the issue of having to repeatedly break the FBX import prefab and re-applying collision to the room every time I re-import it after a change?

This is pretty easy to do. In Maya:

  1. select your wall (in this example Im using a wall with one face only, but if your wall is a flattened cube with 6 faces it will work, but dont recommend it as it doesnt make sense, but whatever)

  2. scale it to whatever size you want; I recommend scaling at the vertex level and not in object mode

  3. make sure you have the polygons toolset active

  4. with cube selected, go to the menu Create Uv’s>Automatic Mapping (options); reset the tool settings and click on Project

  5. done

This should suffice for making some prototype walls.

This shouldnt be happening as Unity should just update the changes. Could you provide some more info as to why this may be happening? Are you changing the name of RoomA everytime you make a change and save?

I’m usually just adding a Mesh Collider to every object in the FBX import object.

(Thanks for your help above on the 3D program way of building a room w/ materials!)