Hi all,
I just wanted to introduce myself and, following in the tradition started by Will and Ryan, start a thread for my new book in case you all have questions, comments or just want to chat.
My name is Sue Blackman and I’ve written this book, Beginning 3D Game Development with Unity (Apress, publishers), especially for artists and designers and those of you who are new to scripting and game development in general. It starts with concepts and terms related to not only 3D, but the differences between realtime and traditional 3D for media.
The book is project based and takes you through the process of creating a classic first person adventure game- a genre that is very forgiving and well suited to beginning scripting. Even if adventure games aren’t your final goal, you will be able to get a handle on the concepts and implementation of game logic, state management, inventory, saving/loading and other in-depth topics useful in many other types of games. The approach is to start small and add functionality a little bit time with plenty of visual feedback for your scripting efforts.
Finally, the book comes with lots of art assets to fill out your environment and develop the functionality that defines the genre. More importantly, you will be able to extend and customize the basic game by making use of any of the extra objects included but not specifically used in the book. This makes it an excellent choice for the classroom where you can break the students into teams and let them use their imaginations to make the book’s project more challenging!
I hope this book will help many of you take the next step toward that ‘dream game’ you’ve always wanted to make!
-Sue
Version change issues:
Changes in Unity 3.4:
You are required to use “internal” rather than “private” when declaring variables that need to be accessed by other scripts but hidden from the Inspector.
This is the cause of the “…is inaccessible due to its protection level.” error.
Changes in Unity 3.5:
“#pragma strict” is at the top of all new [javascripts] scripts. You may not use dynamically typed arrays for mobile platforms and that is what #pragma strict checks for. It will report errors where JavaScript arrays (rather than Unity arrays) are used.
There are several scripts that use JavaScript arrays in the book’s project. The project is not designed for mobile platforms so you can safely remove #pragma strict from the top of the scripts.
Changes in Unity 3.52:
someObject.active = true;
someObject.active = false;
has been depreciated and has been replaced with:
someObject.SetActive(true);
someObject.SetActive(false);
These don’t cause errors, but they do generate a warning
Changes in 4.0:
Importing needs to be handled by using the Legacy option- make sure that after you import, you click on the asset in the project view, click Rig > Animation Type > Legacy, and then apply.Unity is switching the animation control over to Mecanim slowly and we’ve lost functionality in the process for mechanical type animation
in the book, forget about the AnimationObjectsFull assets section- just set up AnimationObjects
Use Legacy Store in Root (new) for the Animation Type
Set up the animation clips
Drag the asset into the hierarchy view
It might look something like:
SomeObjects
objectA
objectB
some other objects
The Animation component will be on the root, SomeObjects
So now duplicate it once for each of the objects that animates, let’s say ObjectA and ObjectB
Rename the root object, SomeObjects to match the one you will leave inside it
then delete the extras in each
so now you might have:
SomeObject
some other objects
ObjectA Group
ObjectA
ObjectB Group
ObjectB
This gives you two benefits- the individual groups can be moved around the scene and the objects can now be triggered independently
to call the animation, you will always need to call it from the parent:
theParent : GameObject = gameObject.Find(“ObjectB Group”);
theParent.animation.Play(); // play ObjectB Group’s default animation
Triggering a second object when one is already playing and they are in the same group can cause the first to stop playing or move to some odd place in the timeline. If you were always going to trigger them one at a time and wait until each was finished you could leave then together.