måndag 25 maj 2015

Importing modells to Unity

Today we imported the table and the couch to Unity, we did also add textures to the couch.

To import a model from Maya to Unity is very easy, you just drag and drop the .mb file from the folder where you saved it to the project window in Unity. Then the model can be used in a scene.


The textures we assigned to it in Maya did not come with the model automaticly, to add the texture we draged and dropped it from the save location to the project window. Then we added the texture to the material that was assigned to the table. The UV mapping is saved in the .mb file which made the texture map the right way.


Next we imported the couch and created two different materials, one for the seat and one for the frame. For the frame we simply assigned the material with a color. For the seat we took a picture of the real thing and used it as a texture.
To make the seat look a bit more realistic we used a normal map, we searched online and found a website where a normal map could be created from a picture Create a Normal Map. Below you can see the difference the normal map does.

Without Normal Map
With Normal Map









Then we wanted to be able to walk around in the scene and look at the modells from different angles, luckely there is a free package called "Characters", which contains a "FPSController" that allows you to walk around and look with the mouse.
To make the character have something to walk on we created a plane and then some walls to limit the area.


At first we were able to walk through the models that was imported, that was solved by adding "Mesh Colliders" to them, we also had to check the marker box "Generate Colliders" for the modells.


Next we wanted to be able to play the "game" here in the blog. We watched this video on how to achieve that but it didn't work at first. This blog was first created on Wordpress and it seemed like you had to pay to be able to embed a Unity game. Then we tried this blog-site and it worked.

Use w,a,s,d to walk, the mose to look around and space to jump. Click in the window to activate it. Click outside it to deactivate.



/Staffan & Jimmy

Inga kommentarer:

Skicka en kommentar