One good thing about having this time off is I can work in Unity and Blender without having to stop and go to bed because I have to get up in the morning. I am currently nearing the middle of chapter 7, have had no real issues with the book so far. I’m not sure she takes as much time to explain some of the tasks as she should but having touched and scanned through books on Unity, C# programming, when she says do this, I automatically do it without thinking how. In some cases the how is a little important and I don’t think as much detail is placed there. Other than that, I am enjoying this book very much. As I am working on my macBook Air right now through Dropbox I don’t have Camtasia or Snagit handy to snap a pic for you. As soon as I get a chance I will snap a pic and post it to this post.
Having a great time and, I think, starting to feel better.
I tried to commit to writing at a minimum of Monday, Wednesday and Friday keeping on topic. I obviously missed commitments for Friday and Monday but I do have a reason. The morning of Thursday 10/2/1014 I experienced a massive heart attack and I was specifically told by my attending physician if it were not for the tremendous life saving efforts of the people I work with, I would not be here today.
Thank you:
Scott Edmonson, Rick Fox, Bob Neubauer and Scott Blankenship
I failed to get mecanim to work in the two days I gave myself. I spend too much time on the book and moving forward there. I am currently in the middle of chapter four but have already read the entire chapter, working through the tasks within in the chapter (scripting) take a little longer as I have to type in the script, absorb it watch it execute etc.. The next chapter in the book is about mecanim but I do have the proper components and animations into an animation controller within Unity so it is taking a little longer than I thought but Friday we should be all thumbs up 🙂
So far working through the new book Unity for Absolute beginners has been great. As I had said previously, the last book was riddled with errors but so far even though there were plenty of errors I had learned a lot and working with this new book has been great.
I also found a video created by Unity for animating anything using Mecanim. While I have found the videos published by Unity are severely lacking in specifics you can get where you need to go from the starting point they get leave you at. With that said, I should have the drawers on my dresser opening and closing using the Mecanim animation system as well as the legacy system. One piece of information the video left we with was that Mecanim is a state machine and having that knowledge leads me to believe this is the system I should be using for my game. Hopefully the next entry should have some videos with mecamin in action.
Yes, as I said in my last post I am back to the Unity Books. I re-downloaded the book files in case they may have been updated during the time I was away.
I was able to apply the animations and when I clicked play the worked! That was my goal for yesterday afternoon and things went so smoothly, much more so than I thought. I was finished within 10 minutes. I decided to take it a step further (remember, baby steps) and write a script to run the animation from the idle state and open a drawer when you press a key. The book I was referencing at the time had a very basic script to do just that and I modified it so you could open/close what ever drawer you wanted by pressing a key, 1-4 (drawers counting clockwise). As written the script did not seem to work without throwing any errors, syntax or otherwise. When I placed sections of the code into the update method rather than the start method like the author had it, it worked great. The amount of errors I see in some of these books out there is amazing. Who proofreads or edits them? These books run upwards of 3o.00!
Tonight I went back to the book ‘Unity for absolute beginners’, picking up where I had left off. The author is going to run through animation techniques using the Mecanim system in Unity vs the legacy system I used for the dresser drawers. When tried to open the project I could not find it anywhere on my hard drive. I think because the project was titled ‘Unity Test’ as per the book I deleted the folder in error. No worries, I caught myself up this evening to, just about to the point I was at prior to setting it aside for a bit.
Here is very brief glimpse of one of the drawers opening in Unity.
My goal this evening is to have my animations working when I press play. At this point I am taking this one step at a time. I have created the asset, my dresser. I have created the simple animation of the drawer opening. I actually created two animations without realizing it. I created one animation of the first drawer on the upper row opening slowly and another animation of the last drawer on the lower row opening fast. It appears the way the animations were imported I can use them on any part of the dresser including the dresser itself. I have imported everything into Unity, game objects, materials and textures. The animations work great in the preview window, now to add the game object to the scene and get the animation working when I press play.
I have some level of comfort exporting from Blender and importing into Unity using FBX finally. I say some level of comfort because it works like a champ using material without nodes. Exporting/Importing with node materials is still a little sketchy. The first little surprise was the materials came over without any adjustment in Unity, meaning when I moved from Blender into Unity the textures were already applied to the materials. Every thing I have watched or read indicated I must drag and drop my textures onto the materials after import and I did not have to do that, it was automatic. The biggest surprise was when I created the animations in Blender. I was under the assumption when I created the animations in Blender the animation would transfer over as a single animation.What I am trying to say is, if I created an animation of two different drawers opening on my dresser, I would get a single animation with both drawers opening when the file was brought into Unity. To my surprise what transferred over was two individual animation files, one for each drawer, a hallelujah moment. Next on the list is apply the animations to the game objects and watch them move in Unity, first in the legacy animation system and then Mecanim, getting the node materials to transfer correctly can wait as I have my first asset created, imported into Unity with animations so it is time to get those to work first.
After I get both types of materials to export correctly and animations working in both animation systems I’ll put something together in print and possibly video showing everything I needed to do. I hope this would help others that have had specific questions along these lines and found it as difficult as I have to get that information in one place.
I made my first attempt at transferring a model from Blender into Unity and ran into one hiccup, the materials did not transfer over. The model looks good but when I select either the drawer or dresser in Unity the inspector shows the same material, ‘No Name’ shader. The problem here is both items have the same material which means when I place the texture into the shader the both get the same texture and they are two different textures. I made an error in the naming of the textures in Blender or did not select a check box or…. I’ll figure it out and update. I’m sure it is something simple.
Edit:
Here is the results of the first import after reverting to regular non-cycles materials. I created and then baked the materials/textures in cycles but had some problems exporting. It was exporting textures that were not attached to any materials. I tried removing all fake users etc., saving and loading again yet, one texture image remained. Now I know why people always ask for a way to view and or delete orphaned textures. So, this is the first iteration, no animations though, baby steps 🙂
My first game asset is complete for testing purposes. Tonight and during the weekend I will be create animations foe each of the drawers with sound of them opening and closing. After this I will be importing everything into Unity and creating scripts to open and closed the drawers. I’m sure this will be just the first of hundreds of test and retests I will be doing during the creation of this game.
Yesterday, I found a book I think I have been looking for. It is called: ‘Practical Game Development with Unity and Blender’, the perfect companion book for what I am trying to do. This book was just released in June 2014 (this year) using Blender 2.68a while I am using 2.71 and while I am not sure of the version of Unity he is using, given the time frame of release I’m betting he is using 4.3 while I have 4.5 (I skipped 4.4 or it was console only, not free). With that said this book looks to be the ticket as it will not be running through all the basics of Unity or Blender interface, which I am very familiar with and, crossing fingers here, getting into some of the things I have been looking for information on. I would much rather find all the information I need myself through searching online, videos or reading books. The last think I want to do is ask on the forums. I am not against asking there, I don’t want my questions to end up being very easy to answer if I had only looked. If I get completely stuck, yes I will ask but only as a last resort.
Here is my finished product: Dresser
New site covering miscellaneous activities including my favorite activity: Blender