Está en la página 1de 59

November - December 2010

unity creative

$5.99

INTERVIEWS, ARTICLES,
TUTORIALS!
Interview with game artist/developer Thomas Pasieka (3D
ATTACK) and Concept Artist Bjorn Hurri (Lead Artist at Opus
Artz Ltd.) - Learn how to make ropes and a rope bridge using
RopeScript2 - Follow us on the 4th part of Shawns C#
tutorial and more...

[1]

A-Lab Softwares RapidUnity Vehicle


Editor Tutorial - FREE CAR INCLUDED
with this issue!

index

Issue Four

5-12

Interview with Artist/Game Developer Thomas Pasieka

14-20

Beginning C# - Part 3 By Shawn McCarthy

22-26

The importance of scale - By Thomas Pasieka

27-33

Interview With Concept Artist Bjorn Hurri

34-37

Creating A Rope Bridge With RopeScript2 By Jake Fletcher

38-40

Making Of - Fairy Cubes by Artex Studios

41-50

RapidUnity Vehicle Editor Tutorial By A-Lab Software

51-53

Code Snippets By David Koontz

54-58

Creating A Simple Chain Rope By Jake Fletcher

Dont forget to check the Goodies folder

[2]
unitycreative

editorial

Hi Unity Creative readers!


WOW...Issue number 4 already, and its
jam packed full of articles, tutorials and
more for you, the Unity user! We hope
you find this issue just as helpful and
entertaining as our previous issues.
As always, I'm happy to read and reply to
any feedback, comments and questions
you may have. Feel free to drop me a line
at 3dattack@3dattack.us.
KEEP ON ATTACKING!

Any attempts to do so will be prosecuted


to the fullest extent of the law as it applies
in Michigan, USA. This applies for both 3D
Attack material as well as any named
artists material contained in 3D Attack
publications. "
Although we read through all the tutorials
and articles, and have proofread them for
errors, we cannot guarantee that they are
100% error free and therefore cannot
issue refunds based on those errors.
3D Attack 158 S. Saginaw St. Chesaning,
Michigan - USA 48616

Tavy
3D Attack

CONTENT
Are you interested in contributing material
for futures issue of Unity Creative?"D o e s
your company have something special to
offer and you want to let the community
know about it? Are you currently
developing a game and want to share a bit
about it? How about sharing what you
know in a tutorial? Contact us with your
ideas at 3dattack@3dattack.us

ADVERTISING
If you are interested in placing an ad in
Unity Creative Magazine, we are happy to
serve. Feel free to contact us a
3dattack@3dattack.us for pricing
information and more.
COPYRIGHT INFORMATION
Unity Creative Magazine and all material
contained therein are copyright protected."
You may not disassemble or distribute
any part of this publication without prior
written consent from 3D Attack directly."

[3]
unitycreative

Create a full game

6HOOLQJDFRPSOHWHJDPHLVQWWKHRQO\ZD\WR

.BLF.POFZXJUI6OJUZ
6HOOJDPHVWDUWHUNLWVFKDUDFWHUVHQYLURQPHQWVDQGPRUH

*DPH6WDUWHU.LWV

6FHQHV

6FULSWV

(QYLURQPHQWV

[4]

DFWLYHGHQQHWFDWHJRU\XQLW\G

:DU3ODQHV
E\PDMGBDEGXO

3UHIDEV

INTERVIEW WITH GAME DEVELOPER/ARTIST

THOMAS PASIEKA
Unity Creative: Hi Thomas, thanks for
taking time to do an interview with us
today, let's dive right in! Please tell us
a little about yourselfwhere were you
born, now live, your family, etc?

Thomas P.: Well, art was always high


priority in my life. Even as a young
child I couldn't resist using Crayons to
pretty up the walls. But on a serious
note, I was always into all sorts of arts
during my school time and I think it just
evolved along with the times and the
introduction of personal computers
such as the C64 and the Amiga. I
remember being fascinated with a
Painting program on the Amiga. I spent
many hours painting on that machine.

Thomas P.: Hi there. Well, I was born


in Duesseldorf, Germany back in 1972.
making me 38 years old now. Most of
my family is still living in Germany and,
since I am half Greek, the other half of
our rather big family is living in Greece.
I have a few cousins who live in
Canada and the US (New York) to be However, I never thought I was good
precise.
enough so, when the time came to go
out into the business world, I opted to
I am a 3D Artist mainly interested in become a Car mechanic. I think the
Environment and Level Design. I am pressure of getting a job and such led
doing all this out of my home office in me into the "wrong" direction. Since I
Michigan, USA.
am not a quitter I decided to finish my
degree as Car mechanic (takes 3 1/2
My wife, Tavy, is my partner, not only in years).
marriage, but business as well. We
launched 3D Attack about 7 year s ago I worked as Car mechanic for like 3
with our digital magazine for CINEMA months after getting my degree and
4D users.
quit. Those 3 1/2 years really gave me
time to think about my future and what
Unfortunately, we recently had to quit I really wanted. I was unemployed for a
producing this magazine for various good year when I quit, and during that
reasons. However, what you are time I fiddled a bit with programming
reading now is our "new" magazine. and arts, and then decided to call a
W e s h i f t e d f o c u s t o " G a m e few Advertising companies to see if
Development" due to personal they would take me on. So I then
i n t e r e s t , a n d s e c o n d l y worked for an Advertising agency for
because I think there is no around 4 years doing what I love - arts.
better time to get into
making games than now. Unity Creative: Your company, 3D
Attack, is widely known throughout
Apple's iDevices and the areas of the 3D community. When did
growing Indie market you first start 3D Attack? How has it
have never been so evolved over the years?
attractive.
Thomas P.: Well as mentioned earlier
we started 3D ATTACK 7 years ago.
U n i t y C r e a t i v e : My wife and I decided that we needed
W h e n did you first discover our own CINEMA 4D forum at that
your love for digital art and time. The forum was booming and
make the decision to follow it into doing good back then and we had little
your career?
modeling/art challenges. One of these

[5]
unitycreative

challenges was to create a "fake"


cover for a magazine and that's when
the idea for our magazine "3D ATTACK
- THE CINEMA 4D MAGAZINE" was
born. So the next step was to actually
make that magazine happen. We
couldn't have done it without the help
of the moderators and other helping
hands and writers.

greater and bigger things - the game


industry. Staying with creating a
CINEMA, 4D magazine, or video
tutorials, just wasn't where we really
wanted to be any longer.
Of course I have always done
freelance work using CINEMA 4D, but
even that declined. Nowadays I have
more work then ever helping others
creating their game assets, and even
making my own games under the 3D
ATTACK name. We produced a few
small casual games and currently are
working on a Triple A Indie title called
"Dungeon Legend", that is a very big
project.

We ran this magazine for a good 5


years on a monthly basis and have
produced hundreds of tutorials and
articles and interviewed many great
artists from all over the world.
However, we noticed a decline in forum
activity (not just our forum) and interest
in our magazine over the years and, at
that point, it was just not reasonable to Unity Creative: Your focus is in the
produce a magazine any longer.
the gaming industry. Do you only work
in this genre? Who are some of your
We had saw a few forums shut down past clients?
over this time, and as it is now there
are only really 2 C4D forums that have Thomas P.: Well, to be honest the last
decent activity left. It's kind of strange job I did that had nothing to do with
to see this decline with an app that has games or interactive applications was
so much potential. We decided to quite a while ago. My entire work
move on to interest has shifted, as mentioned
earlier. In the past I did work for
companies such as Nike, Warner
Brothers, Crocs, General Electric,
Maybach, Johnson & Johnson and so
forth. Those past jobs usually had to
do with creating sales centers, product
design and similar areas. So basically,
it was all about showing off their
products in a photo real environment.

[6]
unitycreative

Not really thrilling work, but it paid


decently at that time. Sometimes I
partnered up with a friend of mine to
work on bigger jobs. I don't rig or
animate so it's always good to have
friends that can do that. I find rigging
not really something I am interested in
(unless they come up with solutions
that allow me to do this quickly). I am
not very patient when it comes to
rigging/animating I guess.

Unity Creative: Besides the obvious,


Unity, what software programs are in
your toolshed?
Thomas P.: When I started out, 13-14
years ago, I really only used CINEMA
4D. I dabbled with a few others on the
side, but never really did any serious
work with them until like 4 years ago.
While CINEMA 4D is a good piece of
software, I think that Maxon has lost
touch with it's user-base.
The core modeling and uv tools are
outdated and haven't seen an update
in many years, so I had to move on
and look for alternatives. Modo is
surely a candidate, but I found it too
unreliable/unstable after working with
it for 2 months, so I decided to not
invest any more time in it. I also think
it's a bit over engineered. Meaning,
they try too hard to do one simple
thing. Then there is Nevercenters
"Silo". I find this to be an excellent

hard surface and subdivision modeler


(if not the best on the market).
I am still using Silo today and I wish
they would push it a bit further. Silo
users seem to be left in the dark as
Nevercenter seems to concentrate on
creating iphone apps lately.
Not a bad thing, but I think they
shouldn't abandon their Silo user
base. ZBrush is also one of my tools
when it comes to high detail sculpting.
Excellent piece of software if you get
used to the interface and the way
thinks work. The possibilities are
pretty much endless with ZBrush. And
then, of course, theres Maya!
Unity Creative: Cinema 4D, Maya,
ZBrush, Silo Modo,WOW! You are
well rounded in 3D applications. Have
you always used so many 3D
Applications? Why do you use so
many? Which is your favorite?

[7]
unitycreative

Thomas P.: To be honest no. In the


beginning of my "3D Career" I pretty
much used Cinema 4D only, as
mentioned earlier. But since game art
is so versatile, and complex in nature,
you would be smart to know at least
the basics in many of the available
programs out there.
That's, at least, my take on it. I really
do use all of the mentioned apps. At
first this may seem like a stretch and
you wish that one app could really do
it all, but there is no such software out
there. Every piece of software comes
with it's own strengths and
weaknesses.
Once you know one of the big 3d
packages it's usually not all that hard
to switch to a different package. It
takes a bit of dabbling and fooling
around for a while, but you usually get
the hang of things pretty quickly.
Today Maya and Silo, next to ZBrush,

are probably my favorite pieces of software. I noticed that I


use Cinema 4D less and less these days. For quite a while
I used to model almost anything with Cinema 4D.
Nowadays I model in Silo or Maya. I still use C4D to
model, as mentioned earlier, but I am rather ticked off by
the fact that they seem running behind the competition all
the time.
Unity Creative: There are several game engines out
therewhy have you chose to work with Unity?
Thomas P.: Well that is pretty easy to answer.
Since I am a Mac user I found out that some
company called OTEE (that's what Unity
Technologies was called in the
old days) created a software
called "Unity". I found it by
browsing the Apple website
for interesting software.
I was instantly hooked on the the "Unity" game
engine and just couldn't quit fooling around with
it. What I immediately loved was the fact that
you could drag and drop meshes and textures.
The pipeline/workflow was just incredibly easy

and addictive, to say


the least. I
became to know
David Helgason , Joe
A n t e a n d N i c h o l a s Francis (the founders of Unity
Technology). Since I published a C4D magazine back
then, I did everything I could to spread the word about
"Unity". I advertised it, for no charge, for many years
because I simply love what these guys did and still do. The
engine itself was also very much affordable at that time
and still is. Deploying a game to Web, standalone Win/
Mac or any of the other available options is still something
you don't find elsewhere today. Unity is incredible in so
many ways. In essence, I got hooked many years ago and
I am still hooked on it today. That's a good thing ;)
Unity Creative: What would you like to see implemented
in future Unity updates/releases?
Thomas P.: Well, I can only speak of features an artist
wants to see. I would love to see a better way of handling
GUI textures/input and more iPhone related updates
(better compression of textures or skinned meshes for
example). There are so many things I would like to see,
but Unity really does have great features already. My
personal favorite with the introduction of Unity 3 is "Beast"
- a light mapper/baker that allows me to light and bake my

[8]
unitycreative

scenes within Unity! Over are the days of trying to get two
uv maps working in C4D (which quite frankly is just
beyond my understanding anymore - how can something
so essential be so complicated in C4D - sorry for the rant).
In any case, I don't have to do that in C4D anymore as I
can now simply create a second uv set for the lightmap
right in Unity! To me, that is a huge time saver and very
much appreciated feature. I would not want to miss this!!
Unity Creative: Ok, I've got to go here, DUNGEON
LEGEND. Please, tell us a bit about this highly anticipated
game you are working on:
Thomas P.: Dungeon Legend is a RPG currently in
production by us "3D ATTACK". I would call this a Triple A
Indie production. It's a rather large undertaking and
requires quit a bit of dedication and a skillful talented
team. I am happy to have a dedicated awesome team of
talents to work with. The game is supposed to hit the iPad
first and later on iphone and other devices as well.

Dungeon Legend is a "Dungeon Crawler" - you take on


the role of a Hero searching for fame and fortune by
slaying monsters and creatures in dark gritty dungeons.
Our game is turn based which all the team members
prefer, probably due to our background in playing
Dungeons & Dragons and other old school RPG's. I
personally think there is more thrill and excitement in a
turn based RPG than a Hack'n'Slash Style RPG, ala
Diablo or WoW for instance.
Everyone involved is working on this game in his spare
time. We can't dedicate all of our time to this game, but we
sure do a good job on moving forward. We hope that the
situation will be different next year so we can spend more
development time on Dungeon Legend.

I am very proud of our team as each and every member


brings his best to the table. Our team consists of...

[9]
unitycreative

Jon Tiller - My partner and programmer who does all the


fancy code work to make this game work. Couldn't do it
without him. Always thinking ahead and trying to maintain
a cool head.
Glen Southern - With his amazing character/creature
modeling skills, for example. He models with the speed of
light and precision of an English Captain on high seas.
Couldn't ask for a better modeling artist.
Erez Yohanan - who is probably one of the most talented
musicians I've ever known. His musical scores for
Dungeon Legend are blowing me away and always hit the
nail on the head. Incredible friendly and awesome man. I
like to call him a real brother.
Bjorn Hurri - is responsible for creating character and
creature concepts. Needless to say, his work rocks and
pushes Glen and Teck to new heights. Sometimes I
wonder where Bjorn gets his ideas from. Crazy talent.
Andreas Knauf - Responsible for Rigging and Animating
the creatures and characters. Surely a job for a skilled
man. He shows a lot of dedication and understanding for
the needs of this project.

Teck Lee Tan - I t ' s g r e a t t o h a v e a w e s o m e


m o d e l s , b u t without textures they are only half as
great, so this is where Teck comes in. His texture skills are
"Pro" and I love seeing the monsters evolve into full
textured pieces of art.
The Team in summary:
Thomas Pasieka - Project Lead/Art Director
Jon Tiller - Project Lead/Programmer
Erez Yohanan - Music/Sound Effects
Glen Southern - Characters/Creatures Artist
Andreas Knauf - Rigging/Animation Artist
Bjorn Hurri - Concept Art / Lead Artist at Opus Artz Ltd.
Teck Lee Tan - Creature/Character Texture Artist
Unity Creative: What's the inspiration behind the game?
Thomas P.: Well we are inspired by many games really.
Baldurs Gate, Dungen & Dragons, Diablo, Torchlight and
many others. We think they are all great games, but we
don't copy what they did. Sure you will find similarities, but
that's a given in the RPG genre.

[10]
unitycreative

Cinema 4D is bundled with a dozen things


that can go wrong, but we now have a
pretty solid way of doing things.
Unity Creative: When will we see this
beauty come to the iPad? Do you have an
estimated release date?

Unity Creative:
What are some of
difficulties you have
had to overcome
during the process of
developing this
game?
Thomas P.: Well it's
not an easy task to
maintain a group of
people that are
scattered all over the
world. This requires
some coordination
and people skills.
Trying to keep everybody happy is my responsibility, next
to creating all the environment art and writing core rules/
mechanics. Takes a bit of extra effort on my end as I have
to take screenshots, videos and write etc., so everyone
understands what I/we need.
Then there is also time zone issues. Jon lives in Australia,
Erez in Israel, Andreas in Germany, Glen in the UK, Teck
in Singapore, Bjorn in the UK and I living in the US. We all
try to communicate via Skype and email. This works pretty
good so far.
There are a few communication issues, due to the fact that
you are "chatting over the internet", and that can
sometimes be a bit frustrating, but it usually gets worked
out rather quickly.
Overall I think it's all working very well. Everyone on the
team is a professional and acts professionally. Then there
are the few software related issues due to the fact that not
all software supports the FBX format as they probably
should. Getting a rigged and animated character out of

Thomas P.: Well


I would love to see
it released around March/April
of 2011, but I am not sure we can reach
that goal. It may or may not be a bit later so at the latest I'd say June 2011.
Unity Creative: Are you currently working on any other
games?
Thomas P.: Well I am always doing freelance work on the
side to make a living, but I am also trying to get a few
casual titles to the iphone/ipad. I am currently working on
a little "Ball Roller" called Rescue Roller that should,
hopefully, be out in the App store in about a month. It's a
trippy fun ball roller and is somewhat comparable to
"Marble Blast", but with additional "goals".
Unity Creative: There are thousands upon thousands of
aspiring game artists and developers out thereif you
could give them one piece of advice, what would it be?

[11]
unitycreative

Thomas P.: Well I suggest you to start out small. Don't try
to make the next big RPG or FPS right away. Try to be
realistic. Make a bunch of smaller games first, as this will
be more rewarding in the beginning. Finishing a small
game is a very important step in your career and the
feeling you get from a finished product/game is invaluable.
Do one thing at a time. Try to focus and stay focused. You
won't get anything done by trying to juggle too big of a
project or too many things at a time.
Unity Creative: Thanks again Thomas. It was a joy to
get to know you and your work better. We are looking
forward to seeing more of you in the future. I give to you
the last word
Thomas P.: Last words, I'd like to thank all my team
members and the community/gamers for supporting
Dungeon Legend and my wife Tavy who has to deal with a
man who lives in a fantasy world called "Dungeon Legend"
for the last year. Thanks everybody! Go and make more
games!

[12]
unitycreative

Create a full game

[13]

beginning C#
part 4

Beginning C# - Part Four


In the previous articles we were exposed to the concept of component design, basic data types,
conversion operators and even looked at basic control structures including selection and
repetition structures. With these basic types and control structures we are now better prepared
to look at object-oriented design.
In this issue our journey will take us into the investigation of object-oriented design. These
class design elements will allow us to encapsulate both the features (attributes) and methods
(behaviors) of our systems to facilitate some added benefits to our program design.
What is Object-Oriented?
Object-oriented approach views a system as a set of interacting objects.
Similar objects in a system can be further grouped and classified as a specific type of
object.
These objects have certain features (attributes) and can exhibit certain behaviors
(methods).
With the object-oriented approach you first identify the objects that are needed in your system,
and then if you need to create new objects first you look around for similar objects and modify
them in a building block approach.
How is Object-Oriented different from Structured
Structured describes the system in terms of the actions that the computer system must
complete. In order to make a system do even simple tasks specific procedural code is
created to specify the verbs (or actions) of the system in detail.
Object Oriented describes the system in terms of the objects that interact that
collectively accomplish the goals of the system.
o OOA Object oriented analysis is defining what the user requires and all the
objects that are part of that work environment.
o OOD Object-oriented design is the defining process that describes how the
objects interact.
o OOP Object oriented programming is creating the statements and defining
the types of objects of the system.
Some high-level benefits of object-oriented include:
Objects in a system are relatively small and self-contained (manageable).
This reduces complexity and can lead to higher quality.
Once an object is defined, implemented and tested it can be reused by other systems.
Reuse can greatly increase productivity and results in better quality.
The system can be modified or enhanced easily, but adding new objects, changing
some types of objects because the objects are self-contained they can be changed,
replaced without interfering with the rest of the system
Here is an over-simplified example of some of the questions a structured programmer would
ask as compared to the object-oriented programmer.
Example:
A system analyst asks an end-user to describe what she knows about the work she does: I
process orders for customers, which might be recurring orders or one-time orders, for all
customers which include both business to business and retail. Businesses to business
customers have many different locations throughout the tri-state area including multiple
receiving docks.

[14]
unitycreative

Structured approach Can you describe the procedure


you follow when you process an order.

Object Oriented Can you describe the difference


between a recurring order and a one-time order? The
business-to-business customers include multiple
receiving docks, what is important about the different
receiving docks as it relates to the orders?
As can be seen by the simplified dialog above, the objectoriented designer is concerned about the objects and
their relations, whereas the structured programmer is
more concerned about the actions (or verbs).

Object-Think
There are a couple of approaches that have been
identified as being successful in getting experienced
systems designers to change their thinking from
structured to object-oriented think.

CRC Cards class, responsibilities of the class,


and collaborators with the class. A Class is a
type or category of an object. Responsibilities are
those things that the objects are responsible for
doing, and Collaborators are the other objects
that become involved when an object carries out
its responsibilities.
o Index cards are used; they represent
objects in a system.
o Each person in the group gets a card and
acts the way the object is supposed to
act.
o The actor thinks of his responsibilities
and roles in the system.
o The people in the group discuss their
roles and responsibilities as these objects
in first person, becoming more used in
talking about objects in terms of what it
knows and what it knows how to do.
o Then the group act out their interactions
(collaborations) that are necessary for
them to carry out their responsibilities (a
taxpayer object might need to ask the
bank object to do something)
Object Think To begin thinking that objects in a
computer systems know things and knows how to
do things. Let the object talk about itself:
o I am a Health Potion
I know my name
I know my content
I know how to heal a player

Basic Concepts
A class is much like a data entity type when
modeling data. (A class is the general category

[15]
unitycreative

whereas an object is a specific instance of), ie.


Potion, Lessor Health Potion.
Attributes A class of objects is often defined by
the attributes that all of the objects in the class
share. All Potions have a name and type. An
attribute is one piece of information that needs to
be known about the objects in the class. Each
object may have a different value for the attribute.
An attribute is equivalent to a data entity type
char, string, etc.
Object relationships A Potion may be
associated with a character, the character may be
associated with many potions, much like data
modeling databases, in a database you can have
a one to many relationship, many to many (which
is really two one to many relationships).
Methods or behaviors The term method means
something that the object knows how to do.
Some OO development methodologies and OO
languages use this term. The term service
usually implies what the object knows how to do,
for a requestor (services are provided to others).
Doing something implies a procedure so really
a method or behavior is really just a procedure.
Encapsulation is packaging several items
together into one unit. With objects both the
attributes and behaviors (methods) of the class
are packaged together. This way the object
knows things (attributes) and how to do things
(methods). It also provides a cover that hides
the internal structure of the object from the
outside world. Other objects (end users!!!) are
prevented from doing anything to the inside of the
object. They cannot change the data or the
methods. This is what we call information hiding.
This way we do not have to know how an object
works to be able to use it, and also means we
can be confident that an object we are using will
not be corrupted.
Messages - When we interact with an object we
send messages to objects and objects send
messages back. An object can also send a
message to another object requesting a service.
(Example, when you press the cancel button, you
send a message to the button (by clicking) and
the button sends a message to the dialog, the
dialog closes). You can think of messages as
commands, as service requests, or data flowing
in/out of the object.
Polymorphism (Latin for Multiple forms). The
ability to send the same message to different
receivers and have the message trigger the right
service greatly simplifies the implementation of
the message sending. For example consider
having three objects, Cabin, House and Boat and
we need to calculate the property tax for each.
The procedure for calculating each tax is quite

different for each of these objects, but the


message calculate tax does not need to know
which type of class it is being sent to. (Multiple
forms of the calculate tax routine can be invoked).
Inheritance In OO one class of objects can
inherit attributes and services from another (this
is also know as is a relationship). This allows
reuse rather than having to re-invent the wheel.
This will become clearer when we talk about a
specific OO programming language.

private are only visible to the declaring class. We will see


examples of these modifiers in the next section.
Access Modifiers
Access modifiers include public, private, protected and
internal and control access to a classes attributes and
methods.
public access modifier for types and type members, and
there are no restrictions (most permissive access is
granted)

Object Oriented Analysis


The process of objected oriented analysis can be broken
into two main objectives:

protected - access modifier for type members, and is only


accessible by the class and derived types.

Defining requirements
o The scenario or use case approach is a
natural way of diving the system into
manageable units. The objective here is
to identify what the system must do and
to complete the required tasks.
Building the model
o Identify the Objects and Classes
o Identify Hierarchies
o Identify Important Attributes
o Identify Object Relationships
o Identify Behaviors - Services and
Messages

internal access modifier for types and type members,


and is accessible by the class and all classes contained
within the same namespace (assembly).
protected internal access modifier for type members,
and is accessible by current assembly or by derived types
private access modifier for type members, and is the
least permissive level (are only accessible within the body
of the class in which they are declared).
Method Definition
It has been explained that the benefits of object-oriented
programming includes the aspect of maintainability
through construction of objects that represent the
attributes and behaviors desired within a system.

When you start off try to first define the main classes,
then further expand and refine as you learn more about
the object structures and their relationships.

Methods provide a mechanism to facilitate the design and


development of classes that support behaviors in
manageable pieces.

Object-Oriented Programming
Object-oriented programming uses classes to
encapsulate behaviors and attributes in order to hide their
implementation details in a concept known as information
hiding. Consider operating a Television set, surely it can
be argued that one can operate a television set without
knowing how a television works.

Methods (behaviors) have the following format:


1: access-modifier return-value method(param-list)
2: {
3: //statements
4: }
access-modifer: As defined above to specify permissive
access to the method
return-value: If a return-value other than void is specified
then the method must contain a return statement
method: can be any value identifier to identify the method
name in code.
parm-list: The parameter list is a comma delimited list in
which the method declares each parameter type and
parameter name (ie. string name)

By creating abstract data types (ADTs) we allow these


types to be consumed by clients in an implementationindependent manner. That is the underlying internal
implementation can be changed as long as the public
visible attributes and methods are unchanged. This is
one of the crucial benefits why information hiding has
been so successful.
Class Scope
Within a class scope, class members (attributes and
behaviors) are accessible by all of the class methods and
can be referenced by their name. When other objects
interact with the class they can only access those
methods and attributes through a reference (static or
instance) that are visible based on the access modifiers.
For example a public modifier is visible to all classes, but

If a method has a return-value of void then a return


statement can be used as in:
1: public void method()
2: {
3: return;
4: }

[16]
unitycreative

[17]

Line 4: Method has no return value so return can be used


to return control to the caller.

As seen in line 9 above the accessor of a property


contains the executable statements associated with the
getting (retrieval) and the setting (storing) of the property.
A property can contain both set and get accessors or just
one of either.

If a method has a return value, the statement must return


an expression of the return type as in:
1: public int method()
2: {
3: int x = 0;
4: return x;
5: }
Line 4: Method declares an int return value so the return
from this method must return an integer value or throw
and exception to return.

set { accessor-body that sets a variable to the value of its


type }
get { accessor-body that returns a value of the declared
types)
1: private string name; // the name field
2: public string Name
3: {
4: get
5: {
6:
return name;
7: }
8: set
9: {
10:
name = value;
11: }
12: }
Lines 4-7: The get access must terminate in a return or
throw statement; it must return a value of the property
type (string in this case).
For example:
string sName = myObject.Name;
Lines 8-11: The set accessor is similar to a method that
returns void and uses an implicit variable this, which
contains the value of the property, type that is being
written.
For example:
myObject.Name = "Test";

With access modifiers, attributes and methods we can


look at our first class implementation.
1: public class Bike
2: {
3:
// private field:
4:
private int m_wheels = 2;
5:
6:
// protected internal property:
7:
protected internal int Wheels
8:
{
9:
get { return m_wheels; }
10:
}
11:
12:
// protected method:
13:
protected void Pedal() { }
14: }
Line 1: This class is defined with the most permissible
access modifer (public), which allows this class to be
used without restriction.

Contructors
When a program creates an instance of a class through
an operation called instantiation, the classs constructor is
called to initialize the classs instance variables
(attributes). A class can contain overloaded constructors
to provide multiple ways to initialize the object. In general
class declaration follow the following form:

Line 4: Private field used to store the number of wheels.


Since this field is private only this class can access the
variable m_wheels.
Line 7: Protected property, which provides access to the
private field m_wheels. Since the property is defined as
protected internal only this class, classes that inherit from
this class, or types within the same assembly can access
this property.

ClassType reference = new ClassType


(initializationArguments);

Line 9: Properties use get and set to provide access to


private variables, get is called when the property is
accessed in a retrieve operation, and the set is called
when it is accessed through a set.
Line 13: Protected method Pedal() can only be accessed
by the class Bike or by classes that inherit from this class.

[18]
unitycreative

C# 4.0 brings the concept of optional parameters, which


greatly simplifies the concept of operator overloading,
prior to C# 4.0 we could have generated multiple
constructors for the Person class to support the different
calls.

"(none)")
10: {
11: }
12: public Person(string firstName, string lastName)
13: {
14:
msFirstName = firstName;
15:
msLastName = lastName;
16: }
17: }
18:
19: Person person = new Person("Shawn");
//
Shawn (none)
20: Person person1 = new Person("First", "Last"); //
First Last
21: Person person2 = new Person();
// (none)
(none)

1: public class Person


2: {
3: private string msFirstName;
4: private string msLastName;
5:
6: public Person(string firstName = "(none)", string
lastName = "(none)")
7: {
8:
msFirstName = firstName;
9:
msLastName = lastName;
10: }
11: }
12:
13: Person person = new Person(firstName: "Shawn"); //
Shawn (none)
14: Person person1 = new Person("First", "Last"); //
First Last
15: Person person2 = new Person();
// (none)
(none)

Lines 6-8: The default constructor (no parameters) uses


the notation: this((none), (none)) to call into another
constructor passing in two parameters.
Lines 9-11: The constructor that takes a single
parameters (firstName) and again uses the this reference
to reference the constructor that takes two parameters.
Lines 12 16: The original constructor (without optional
parameters) that all the other constructors reference
through the this reference to set the values of the
parameters.

Lines 6-11: The constructor here contains two optional


parameters (what makes them optional is the default
values that are supplied (none) for each string value.
That means that the parameter can be set or not set.

This reference
As seen in the previous example the overloaded
constructors used the this reference to access the
constructors in the following form : this(parameters).
Every object can access a reference to itself through the
this reference.

Line 13: Here a person is created with the firstName set


to Shawn and no value set for the lastName parameter.
Line 14: Here a person is created and both parameters
are set resulting in firstName set to First and lastName
set to Last.
Line 15: Here a person is created with no parameters and
therefore both the default values are used. In this case
firstName is set to (none) and lastName is set to
(none).

The this reference can access instance variables,


properties and methods of itself. Sometimes an explicit
call to this is needed (as was in the constructors), and
also to make sure you are referencing the instance
variables rather than variables local to the method (in the
case the variables use the same name).

C# 4.0 provided named and optional parameters and is a


great improvement over the alternative. In the following
example (prior to C# 4.0) you would need to define at
least three constructors to accomplish the three different
ways we constructed a Person above.

If you want to assure you are accessing the instance


variable (class attribute) use the this reference to avoid
subtle issues when local parameters or method
parameters use the same name otherwise the local
variable will be referenced (as local scope is accessed
first).

1: public class Person


2: {
3: private string msFirstName;
4: private string msLastName;
5:
6: public Person() : this("(none)", "(none)")
7: {
8: }
9: public Person(string firstName) : this(firstName,

[19]
unitycreative

Next Issue
In the next issue we will cover static, const and readonly
members, as well as indexors in the context of lists of
elements. We will further take a look at array types and
how indexors can be defined on classes to provide array
style access to them.

Shawn is also the Technology Leader and co-founder of


an independent game development company (Six Times
Nothing). You can reach Shawn at
(shawn@sixtimesnothing.com) and follow the teams
projects at www.sixtimesnothing.com.

The article will then cover one of the main features of


object-oriented programming inheritance which will allow
us to see a form of software reusability in which classes
are created using another class to provide the base data
and behavior.

As always if you have any suggestions or questions


please do not hesitate to contact me, I really do enjoy
hearing from you.
Shawn McCarthy is an experienced Business Systems
Architect at First Data. Shawn graduated with a Masters
in Computer Science and Engineering with an emphasis
on Artificial Intelligence on May 16th, 2009.

[20]
unitycreative

[21]

THE IMPORTANCE OF

SCALE
I am pretty sure that almost all of you have dealt
with "scale" issues during your game projects.
Often you have to re-scale an imported object
because it is sized twice as big as the other
objects in your scene. The problem becomes
even bigger when you start working with a team
of artists. If all of your artists scale their objects
as they see fit, you are in for some trouble or
constant adjusting of delivered assets. That's
not really practical or fun. Best thing to do in
advance is to tell all your guys on the team to
use proper sizing/scale.
All these game engines out there
have, almost certainly, a different
way of handling scale. Valve's
Source Engine, for example, has
some important info about the matter
and how to set up your models.
According to Valve you have to set up
your map/levels to their specifications (if
you want to avoid problems you'll stick to
that). Have a look at the following table
taken from Valves website:
Map Grid
1
2
4
8
16
32
64
128
(160
256
512

Imperial
=
=
=
=
=
=
=
=
=
=
=

0.75"
1.5"
3"
6"
1'
2'
4'
8'
10'
16'
32'

Metric
=
=
=
=
=
=
=
=
=
=
=

0.01905
0.04
0.08
0.15
0.3
0.6
1.2
2.4
3.0)
4.9
9.8

Player Collision Hull


32 = 2' 0"
width & length
36 = 2' 3"
height crouching
72 = 4' 6"
height standing

[22]
unitycreative

Player Eyelevel
28 = 1' 9"
64 = 4' 0"

height crouching
height standing

Architecture
128 = 8'
64 = 4'
108 = 6'
48 = 3'

normal
normal
normal
normal

0"
0"
9"
6"

corridor height
corridor width
door height
door width

Did you have a good look at the that table? Good, now
forget about it. Get it out of your head, as handling Units
in Unity is much easier. Lets have a look at something
simple, yet very important in Unity, The Grid.

Unitys Scale:
1 Unity Unit = " 1 Meter or
#
#
3.2808 Ft. or
"
"
1.0936 yard

As you can see below, I placed a cube into an empty


scene in Unity. The grid is active (visible) to demonstrate
the importance of it. The cube you are looking at was
created by going through the menu in Unity (Go to Game
Object -> Create Other -> Cube).

Have a look at the following table for more Length


conversions.

If you move the cube just by 0.5 Units in the X,Y and Z
axis, you will notice that the cube perfectly fits onto the
grid between the grid lines. That tells us that Unitys Grid
is actually 1 Unit wide.
Important: 1 Unity Unit equals 1 Meter
So now that we know that that Cube is 1 Unit, or 1 Meter,
we have something to work with! Not only is that info vital
for your 3D Package, but also important if you deal with
Physics in your game. Personally, I believe that Unitys
Unit system makes the most sense. No need to convert
from that to anything else but the very easy to use metric
system. In any case, if you are not familiar with the Metric
system have a look at the following little summary:

[23]
unitycreative

Now that we know all the above, we should figure out how
to reproduce the Grid and size of the Cube in our 3D
Application, so we can export models out of our 3D App of
choice, and match that very cube we created in Unity.
Once youve set this up properly you need to tell your
team mates to do the very same so you are all on the
same page. This will make sure that everybody uses the
same scale in their documents and therefore the whole
process/pipeline will be much smoother.

make it exactly 1 Meter tall in all dimensions, as shown in


Point Nr.4. If you set up everything properly you should
move the Cube by X=-0.5 Y=0.5 and Z=-0.5 and it should
match your Grid exactly.
So far so good, but how do I know that this is the same
size Cube as in Unity? Well, lets export it as FBX! After
importing into Unity with the factor of 0.01, you will notice
that its fitting exactly onto the Grid, just as the Cube we
created before in Unity. Well done!

It really is of great importance to get the Scale issue


figured out before you actually get busy on creating a ton
of assets. Too many artists overlook this vital step and run
into issues later. Of course you can always resize an
object during import into Unity but do you really want to
do this a dozen times a day? I surely dont. So lets see
how we can actually reproduce all those settings.

Lets try it with Cinema 4D, for example. Have a look at


the Screenshot below. I created a Cube in Cinema 4D
R12 and made sure my Unit system is set to Meters
which should be your first step (as shown in the image
below marked with the Nr. 1). Now go into Edit, as
shown below in Nr. 2, and select Configure All which will
lead us directly to Nr. 3 where we set our Grid spacing
and Lines. I went for a Grid Spacing of exactly 1 Meter.
Feel free to change the Lines to whatever number you
desire. Now, in my next step I will create a Cube and

After exporting as FBX into Unity

1 Meter/Unit Tall in all directions

3
4

[24]
unitycreative

Lets head over to Maya. We will basically have to do the


same as we did in Cinema 4D. First we will change the
Grid spacing to our desired length. Have a look at the
Maya screenshot below.
Change the Grid lines to every 100 units with a
Subdivision of 1. If you go ahead now and create a cube
with the dimensions of 1 (X,Y,Z) the Cube should fit
exactly onto the Grid (if you move it X=-50, Y=50, Z=0).
Again, you may want to export that Cube as FBX out of
Maya and import it into Unity using the import scale factor
of 0.01 (standard import setting in Unity) as seen on the
right (marked in Orange). Unless you really need to, I
wouldnt change that Scale Factor.
So, lets have a look at what we did so far. We changed
the grid settings in Cinema 4D and Maya. We exported
the cube from both applications and double checked to
see if the cube has the exact same size as a cube
created in Unity. Both 3D Apps are now set up .

[25]
unitycreative

The screenshot above shows a cube in Silo, which is an


excellent piece of modeling software and highly
recommended. I adjusted the Grid here, as well, to my
needs. The cube is again 1 Unit in all dimensions and
exporting it as .OBJ will lead to the desire 1 Unit sized
Cube in Unity (if Scale Factor is left to 0.01 in the FBX
import settings).
You should know have a pretty good understanding of
how you can set up your 3D App, of choice, if you arent
using any of the mentioned apps here.
What I havent mentioned yet is the fact that the Grid
changes we made are really only set to those values to
assure the Cube is sized properly. If I want to model in a
modular fashion, in my 3D App of choice I actually half
that to 0.5 Grid spacing. Its easier to have modular
meshes snap to a Grid like that. More on Modular
modeling in the next issue!

Grid Spacing set to 0.5


for modular modeling and
easy snapping.

Thanks for reading!


Thomas Pasieka
http://www.3dattack.us

[26]
unitycreative

Interview With
Concept Artist
Bjorn Hurri
Unity Creative: Hello Bjorn. It's great to have the
opportunity to interview you. The reason I was wanting to
interview you is because you have been working in the
game industry as a concept artist. Can you tell us a bit
about yourself?
Bjorn Hurri: Hi Thomas, Well I am currently the lead artist
at Opus Artz ltd, an outsourcing company for the
entertainment industry, in London. I have been in the
industry for a few years now. I started it all with some Indie
development back in 2000, some projects with their own
engine, some as mods for an already existing one.
I think at that point I really got a taste of it and ever since I
have been pursuing a career in it aggressively.
Unity Creative: What did you do before you started
painting? How did you get into concept art?

[27]
unitycreative

Bjorn Hurri: I have always had an interest in art, been


drawing since I could remember. Me and my brother used
to do our own table-top games. I think an interest for
games arose when my family got a NES when I was a kid.
Me and my brother played it A LOT! I think that contributed
immensely to my choice of career, I also love to create
worlds. I used to tell made-up adventures for my cousins
as bed time stories.
As an adult, one day I just had enough of regular manual
labour so I quit, and devoted all my days to art. I haven't
stopped and probably never will.
Unity Creative: It sure takes some guts to just quit
everything and devote all your time to painting like a
maniac. I, however, think that your devotion shows in your
work. Are you able to tell us on what sort of games you
have worked on in the past?
Bjorn Hurri: I can of course not talk about all games I
have worked on as a lot of them are still in
development, some are cancelled etc.
That is how the industry is. I did a
lot of work for SEGA the last few
years before I switched studios. It
was a lot of fun.
I have also done a bit of work
for NCsoft, EA, Microsoft, Sony
and other publishers I can't
really talk about.

[28]
unitycreative

Unity Creative: I understand. Not a problem. I know a lot


of your artwork and often I wonder "Where does he get his
inspiration from"? I often think you must be crazy (in a
good way).
Bjorn Hurri: Yea, a lot of people have the same perception
of me, must be something wrong with me? Naa, I just
really enjoy thinking about what I draw. I try to come up
with new characters, or worlds, to invite people into and
explore them.
Unity Creative: Well, you are doing a fantastic job at that.
Let's talk about your tools. What do you use to paint and
why?
Bjorn Hurri: I use a Cintiq 21UX and
Photoshop. I used to have Photoshop 7 for
years, but I recently got a hold of a copy
of CS4 that I have been enjoying quite a
bit. If I go traditional, I use anything I can
find. Anything goes really.
Unity Creative: Do you even have
time, or the will, to paint outside of
"work hours" these days?
Bjorn Hurri: Yes, or maybe I
should rephrase it to that I
"make time" to paint. I try
to paint every night after
my son goes to bed. I
have a few projects I
work on, love it!

[29]
unitycreative

Unity Creative: So you're pretty much full of passion when 3. ...then draw some more!
it comes to painting. Your specialty seems to be Creatures/
Monsters. Not much into environment concept?
Unity Creative: That is surely some good advice there. Do
you think becoming a concept artist is a good career choice
Bjorn Hurri: I do quite a lot of environments professionally. these days? It seems as the game industry is using concept
My passion lies in characters and monsters though. They art more and more in public as well.
are so much fun to draw. Every boys fantasy to do it as a
living.
Bjorn Hurri: Oh I don't know. It is a very competitive market
and a lot of fish in the sea. Personally I was never worried
Unity Creative: What kind of advice can you give aspiring because I had the firm believe that my work would ideally
concept artist?
speak for it self and work would come on its own. It is a
good career choice if you make it. Definitely money to be
Bjorn Hurri: That is a bit of a tricky question as a lot of made if you are into that. In a perfect work we could all do it
people want different things. I have a few good pointers for the love of creating instead of the pay slip.
though.
Unity Creative: Unfortunately we all have bills to pay.
1. Make sure to work on your networking skills, make some Different question... do you have personal game projects
friends in the industry or fellow artists. You'd be surprised you are working on?
how much that pays off in the long run.
Bjorn Hurri: Yes, I am creating a pixelated cat burglar
2. Make the decision to go all out. If you want it you have to game with a friend of mine. We are still working on the
bleed for it. Draw draw draw.
"skeleton" but we will soon be ready to show some

[30]
unitycreative

interesting stuff from it. I did post some sprite test a year
ago or so and a lot of blogs showed some interest in it.
Hopefully it will end up in a finished product that we can
share with game/art enthusiasts.
Unity Creative: Sounds great! What game engine are you
using for your project?
Bjorn Hurri: We are making our own engine, but we are
still open for the possibility to port it to other engines
depending on the need.
Unity Creative: Is the Unity engine a possible candidate?
Bjorn Hurri: Yes, it is. We have actually done some
extensive research about it and it is one of our top
candidates to port to. We started the project using Unity, but
we quickly realized we wanted to build the base functions of
the game in isolation. A home brew engine was ideal as we
could quickly make tailor-made prototypes as a proof of
design before we go full steam ahead.
Unity Creative: That's great to hear. The Unity engine is
surely more than capable. Next question. Do you teach
individuals or do you have training videos of any kind?
Bjorn Hurri: I have had a few people studying under me in
the past. It is nothing that I have as a routine though as it is
quite time demanding for both parts. Currently as a Lead
artist at Opus Artz, one of my responsibilities are to coach
my team to higher heights.

[31]
unitycreative

On the topic of videos, no unfortunately I have not any Unity Creative: Thank you very much as well Bjorn. It was
training videos up. I have plans to make a dvd at some a pleasure to talk to you as usual. Best of luck for your
point but at the moment there isn't enough hours in a day.
future!
Unity Creative: Yeah I can understand that... time is Bjorn Hurri: Cheers
something very precious. Speaking of which, I don't want to
take any more of your time as I am sure you have to attend Please visit Opus Artz if you are in need of concept art:
to family matter with your newborn baby and all.
http://opusartz.com/
Bjorn Hurri: Thank you very much for the interview, very
good questions! Best of luck!

[32]
unitycreative

[33]
unitycreative

Creating A Rope Bridge Using RopeScript 2


Download Link:
www.reverieinteractive.com/cgi/downloads.php

import. Go ahead and make sure all of the files are select
and press Import.

Setting up and opening the tutorial scene:

Finally we need to open up the tutorial scene. To do this


simply double-click the BridgeTutorial_Blank.

In this tutorial we will be using the unity package that you


should have already received. If you have not yet received
this package you can find it on the Reverie Interactive
website in the downloads section.
I took a great deal of time making version 2 compatible for
Unity 2.6 and higher so any version greater than 2.6 should
be OK. If you have a version that is lower than 2.6, you can
still give it a try but I do not support any issues with scripts
that do not work in version lower than 2.6.
#
To get started creating your first bridge using RopeScript 2,
you need to open up Unity. Once Unity has loaded go
ahead and import a new unity package by right-clicking in
the Project window and selecting Import Package....
This will open up a open file window. Go ahead and find the
package and click Open.
#
After clicking Open you will be presented with yet another
window asking you to select which files you would like to

Creating the rope part of your bridge (Part 1 New Rope):


Be forewarned that the more detail that you add to your
rope in this section, the more time you will be spending
later on connecting planks. For this tutorial I kept the detail
of the ropes at a low 10 segments.
Creating a rope with the new editor is simple. To create the
rope go to the menu bar at the top of the screen and select
RI Stuff. The drop-down will reveal a New Rope
selection. Simply click on this and a new rope will be
generated in the center of your scene. Reposition your rope
to equal (0, 5, 2) in your Position.
By default the rope will be assigned the LineRenderer
skin type. In Unity 3.0 this will show up as a bright pink line
and in other versions it will show up as a gray line. For our
bridge we are going to use the prefab mesh type. To
change mesh types click on the newly created rope and in

[34]
unitycreative

the inspector you will see a section called Rope Type.


Click on the drop-down and select Prefab. At first your
rope will be blank and the editor will have a block of yellow
text. This is only because you have not yet assigned a
prefab to your rope.

influenced by detail is the Link Scale setting. If our tutorial


calls out for a detail of 10 and the best looking link scale
ends up being 0.75, then this means that if you have a
detail of 20, your optimal link scale will be somewhere
around 1.5.

To assign a prefab to your rope, click on the Link Prefab


box or button. A window will pop up displaying all of the
assets in your scene. For our bridge we will want to select
the ChainLink prefab. Once you have selected your
prefab, you will instantly see it show up on your rope. Go
ahead and set the Rope Detail to 10 if you would like to
follow along with us.

I highly suggest playing around with settings. Not only will


that help you learn the simplicity of this editor, but it will
also help you achieve an optimal visual effect.

Because our ChainLink prefab was created in our 3D


editor facing the Z axis, it will be rotated in the wrong
direction. Follow the next steps in order to get the links
pointed and oriented in the right direction.

pointing in the correct direction, use he Long Axis variable


to orient it right. I cannot tell you exactly which variable to
use as this is a per user basis.

Creating the rope part of your bridge (Part 2 Orientation):


If you chose not to set your rope detail to 10 as stated early
on in the previous section, you might need to play around
with your settings more. The most critical setting that is

To get our chain links to point in the correct orientation we


had to set the Long Axis variable to Y. If you used your
own custom link and built your link along an axis that is not

Now that you have your links oriented right, they might look
a little too big. To make the links fit better and to make the
chain look a bit more realistic, lower the Link Scale value
down to 0.75. You may also notice that your chain is flat! As
we all know, a chain has alternating segments. In order to
duplicate this we make sure the Alternate Links check-

[35]
unitycreative

box is checked, and set the X value of the Link Rotation


to 90.
Creating the rope part of your bridge (Part 3 Physics
[Optional]):
This section will cover the basics of creating colliders for
your new chain. You do not have to follow this section as it
is not absolutely critical! Again, I encourage you to tinker
around with these settings. Especially in the Joints
section which will not be covered in this tutorial).

When you make a new rope, the default collider will be set
to Capsule. This collider works great for round ropes but
with our bridge using chain instead of ropes, it will result in
unrealistic collisions. To chance the collider from Capsule
to Cube, simply select the drop-down next to Collider

When you select the Cube collider you will notice that 2
new properties showed up. The first is called Collider 1
Size. This property is used to set the size of the collider for
all of the normally oriented (Non-Alternate) links. The
second property called Collider 2 Size is used to set the
alternating links collider size. Also note that if you did not
select Alternate Links the second collider size property
would not be visible.
When editing colliders, it would be nice to see what we are
doing. Fortunately for you and me I have included the
ability to preview the colliders as you edit them. To enable
this, go to the Preview section of the editor. Next check
the Show Colliders check-box and you will instantly see
your colliders. Be warned that if you are using a slower
computer, the more links you have the slower your editor
will run with this setting.

Type and select Cube. (As a side note: During the time I
wrote this tutorial, the new collider type Mesh was not yet
working!)

The colliders are all shaped like a box right now because
the X, Y, and Z values are set to 1 in both properties. To get
your colliders to follow the shape of your links better set
Collider 1 to (2,0.75,3.5) and Collider 2 to (0.75, 2, 3.5).

[36]
unitycreative

You will need to make 4 copies of the cube and position


them at the following positions and name then in the
following convention. Cube1 (-8,5,0), Cube2 (-4,5,0),
Cube3 (0,5,0), Cube4 (4,5,0), Cube5 (8,5,0). Naming
them isn't that important but I suggested it as it will make it
much easier to follow along with this tutorial.
To connect these cubes to your ropes you need to select
one of your ropes and go to the Attach area. Click Add
Attached Object button 5 times. In each section you will
see an Object property as well as a Link Index property.
The Object property is where you will put your cubes.
Start placing cubes by dragging and dropping them in
chronological order (Cube1 Attached Object 1).
Next we need to assign each object to a link. To do this we
use the Link Index property. When doing this on your own,
you might need to use trial and error to figure out which link
should be connected. For our chain the link index's will be
1, 3, 5, 7, and 9 where Attached Object 1 has a link index
of 1.
Repeat the previous step for the other rope and you have
finished this tutorial.
Press play to see the results!
Attaching the planks and finishing the bridge:
Jake Fletcher
Although this section of the tutorial may seem like the
shortest, it is also the most tedious. I have not yet created
an editor to help along with this process but anyone who is
good with programming is welcome to add onto my script to
include this capability!
To finish off the bridge we will need to add planks! In our
tutorial we we are using generic blocks which can be added
from the Game Object Create New Cube menu.
Go ahead and add a new cube. The size of the cube
should be set to (1,0.5,1.5). I know this looks very
unrealistic but we can use our imaginations for the sake of
this tutorial!

[37]
unitycreative

MINI POST MORTEM

Artex Studios - Fairy Cubes


As a thriving studio - having previously created handheld and casual PC games - we began working on
our next project called Fairy Cubes for iPad, iPhone, Windows and Mac OS X. Artex Studios was found
by Jzsef Trencsnyi in 1999. We made a number of games for Windows, Linux, Xbox, Nokia N-Gage,
Tapwave Zodiac, Gameboy and for many other platforms. The middleware tools always played
important part in our projects because of cross-platform development. We tried a big amount of 2D, 3D,
audio- and physical engines year by year or we made full games with them. This was of significant
assistance to us in cases of scant budget or lack of time. It was obvious at the very start of Fairy Cubes
project that we would not use own game- engine for this development neither but we would make this
game with Unity.
[38]
unitycreative

What Went Right 1. Focusing on Quality


We created Mahjong Zodiac in 2008, which turned out a
great success among the Windows and Linux players
too. The Fairy Cubes 3D was produced from this earlier,
Mahjong Zodiac 2D gameplay reconsidered, expanded
set-up. In this way we achieved that the Fairy Cubes 3D
gameplay, comparing to the original 2D gameplay, gives
more extra experiences, because the players able to
apply new strategy with rotate of the cubes. The
essentials were producing an enjoyable gameplay.
2. Testing and Debugging
We tested the game within doors and we had only few
problems in the course of testing. The Unity 3 new
debug system with support of MonoDevelop simplified
considerably to search for bugs and the refinement of the
gameplay. After all we use the traditional Debug.Log
based method too.
3. Quick Iterations
We were able to try different game elements and new
ideas extremely fast with help of Unity in the course of
development of Fairy Cubes. We proved three different
gameplay mechanics in the prototype period. However we
have already used many other game-engines, the Unity
was the only one which provided facilities to prepare
different prototype phases in such a short time.
4. Level Design
One of the most important elements of the gameplay of
Fairy Cubes is the diverse set-up of levels. On the
development we did not make editor, but stored the levels
in arrays. As the type of cubes were defined dynamically,
only the place of them had to be given. In spite of manual
way we managed to complete the task fast and easily.
5. 2D BackgroundsWe used real places for reference in
creating the hand-painted backgrounds. For example the
reference photos of the fairy place background was taken
at Tata which is a charming village near by Budapest. It
was pouring with rain all the way Tata but when we arrived
to the village, it calmed down and by the time we got out
the car the sun had started to shine. In this way we easily
took a big amount of inspiring pictures. The hand-painted
backgrounds, the logo and the graphics of the cubes was
designed by Erika Salamon.
6. Budget
Although the amount what we could invest to the project
was extremely small, we were able to harmonize the
budget with the necessary time and resources. The
Unity3D gave us an effective assistance not to overstep the
time what we had for the development. Hopefully we
succeed in keeping this efficiency in our next developments
too.

What Went Wrong 1. 3D Backgrounds


We had a plan to create full 3D backgrounds. Accordingly
the background behind the cubes would have rotated with
the camera in every single rotation to suggest perfect
feeling of three-dimensional view. After some tests we had
to understood, that we did not have ability to apply so much
polygons if we wanted to support iPhone 3G too. By this
time we had made the decision to paint the backgrounds
by hand. This change took us for a long time and extra
man-hours.
2. Schedule
We made the classic mistake which everybody always
made. We underestimated the time which the development
of the game was need. There was calculated one or one
and half month, but finally it was taken two month, so we
overstep the available time with 35-50 percent. In the future
we must estimate the time more precise because in the
case of a big project it would be harder to handle a lag like
this.

[39]
unitycreative

3. iPhone and iPad porting


It was already clear at the designing period that we would
like to make a game which is in good working on mobile
and desktop platforms as well. Accordingly we paid
attention at coding that the contents would be fit for Unity
and the Unity iPhone. Using often the #pragma strict we
made an effort to avoid the dynamic typing at variables in
our source codes but some GameObject-Object conversion
was lurked some places generated some problem at
porting to iPad.
It was proved the power of Unity 3 because we succeeded
to solve these problems in some hours, and the porting
was taken place in less than 24 hours.
Conclusion
In the end, we are very happy with the game. A lot was
learned from the development, and we continue to work
towards improving the game's player experience through
updates, new levels, tiles, stages and bonus items in the
near future. Unity 3D definitely worked well for us.

We are very proud of Fairy Cubes and what we


accomplished.
Developer:
Artex Studios, Inc., Hungary Publisher: Artex Studios, Inc.,
Hungary (www.CasualGameStore.com)
Release date: October 2010
Platform: iPad, iPhone, iPod Touch, Android, Windows,
Mac OS X
Number of full-time developers: 2
Overtime hours worked per person per week: 35 hours
(estimated) Number of contractors: 0
Length of development: 2 months
Coffees drank: 180 (estimated)
Technology: Unity (2.6.1 & 3.0.0), Xcode (3.2.4), Blender
(2.49b & 2.54), Photoshop CS5

[40]
unitycreative

RapidUnity
Vehicle Editor
Tutorial

Welcome to my RapidUnity Vehicle


Editor tutorial. Before I begin I just
wanted to give you some background
t o m y Ve h i c l e E d i t o r a n d m y
RapidUnity concept.
I first discovered Unity when v2.5 was
released, and Unity was unleashed to
PC users, I immediately fell in love with
this incredible product, and spent my
time learning how to use Unity,
following the different beginner tutorials
and reading the user documentation.
As my learning journey continued, I
realised that some of the more
complex uses for Unity development
were not as easy to produce as I had
first hoped.
So my RapidUnity concept was born, I
wanted to create middleware tools for
Unity to help users, and to increase
their productivity within Unity.
The first tool I wrote is the Vehicle
Editor, as I had found lots of articles

RapidUnity Vehicle Editor


My Vehicle Editor allows
any Unity user to quickly
setup and rig any four
wheeled vehicle,
and then drive it
about a scene.

[41]
unitycreative

and tutorials around the web


explaining how to create car games in
Unity, however I had not managed to
successfully achieve what I wanted, I
was always trying to bend someone
elses solution to my needs.
My Vehicle Editor allows any Unity
user to quickly setup and rig any four
wheeled vehicle, and then drive it
about a scene.
As well as my Vehicle Editor, I have
created a Scripting and How to guide,
which covers lots of useful topics you
might want to learn about within Unity. I
have also created a Light Library which
enables quick lighting setups, at the
click of a button, and my latest tool is
called Array Wizard, it allows users to
create copies of GameObjects in a
scene in different formations, such as
rows, circular shapes or across terrain.
Learn
more
at
http://
www.rapidunity.com.

OK, lets get started on my tutorial! In this tutorial I will


show you how to take a car model from the web,
configure it for use in Unity, and then set it up with my
Vehicle Editor, and finally drive it about in Unity!

Step 2 Configure car model using a 3D Authoring


Application
For this step you are welcome to use your preferred 3D
Authoring Application; however for the purposes of this
tutorial I am using AC3D, this application is available for
both PC and Mac users.

Download, configure, import and drive your own cars in


Unity3D!

If you are using your preferred 3D Authoring Application,


you can skip this section, however you need to edit the
Porsche model, and create two 3DS files, one with just
the body/chassis of the car, and another of just one
wheel, both objects need to have their object axis set to
the center.

Step 1 Download 3D car model from web


There are many 3D car models available on the internet,
some to buy, and others available for FREE. The car
model I have chosen for this tutorial is FREE, and it is a
very high quality model.

NOTE: The car model downloaded in step 1 is in 3ds


format, if your preferred 3D Authoring Application cannot
read 3ds format files, you can use AC3D to convert to a
Collada .dae or Wavefront .obj formats. If you prefer to
work with .fbx format, you can use Autodesk's FREE FBX
Converter for PC or Mac, which are available from the
following links:

So lets download the car model, open you browser of


choice and enter the following web address http://www.
3dvia.com/models/F7AFDBEDFFD1E3F5/porsche-997gt3-rsr
You will be presented with the page shown below (see
figure 1), simply click the Download link circled in RED.

PC #
http://images.autodesk.com/adsk/files/
fbx20113_1_converter_win.exe
Mac#
http://images.autodesk.com/adsk/files/
fbx20113_1_converter_mac_enu.pkg.tgz

If you are not a member of 3dvia you will be required to


create an account, this is completely FREE and only
takes a few minutes.
Once you confirm your account, you will be able to
download the Porsche 997 GT3 rsr.3DS.zip file, it is only
1.5Mb so it wont take long!

If you are not using your preferred 3D Authoring


Application, then enter the following web address into
your browser http://www.inivis.com/downloads.html

When downloaded, simply unzip the contents to a folder


on your computer.

[42]
unitycreative

From this page you can download AC3D for Windows or


Mac, AC3D is FREE to use for 14 days, with no
restrictions, simply click the links on the page to
download the software and install onto your computer.

Now we need to separate the car body from the wheels,


and save a separate copy of the car body, and a single
wheel as 3DS files.
If you are using your own 3D Authoring Application you
can go ahead and do this now.

Once installed, open AC3D, and click the File menu,


select Import.

If you are using AC3D, please follow the next steps


carefully.

A file dialog will appear, locate the Porsche 997 GT3 rsr.
3DS file in the location you unzipped the files to in the
previous section, and click Open. (Refer to figure 3)

First open the Hierarchy View (Refer to figure 5), click the
Tools menu, and select Hierarchy View, or use the
keyboard shortcut by pressing F8.

The model will take a few moments to import, once


imported you should see the car in the scene views as
below. (Refer to figure 4)

First click the + symbol to expand the hierarchy, then


click the Select none button, to deselect all the parts
of the car model.
Now select Object07, by clicking on it, do the same
for Object30, and also for both 996GT3_CAL and
996GT3_DIS. (Refer to figure 6)
Next click the File menu, and select Save
Selection, type wheels, and click Save.
Finally click the Edit menu, and select Delete.

figure 4

[43]
unitycreative

figure 8

Now change the Loc x, y and z values to 0, and click


Close.

figure 6

Now we only have the car parts left that we require


for the body of the car, and we just need to center the
object at 0, 0, 0, and also center the object axis.

Lastly, click the File menu, select Export, and then


select 3D Studio, click No to the Trial Version
dialog, type body in the File name field and click
Save.

Click the Select all button in the Hierarchy dialog box,


and click the Group button, then click the Move to
button on the left hand menubar. (Refer to figure 7,
Move to button is circled in RED)

Thats the body done, now lets move onto the wheel,
click the File menu, and select New, select Yes to
clear the scene.

Now lets reload the wheel selection we saved earlier,


click the File menu again, and select Open, select
the wheels.ac file, and click Open.
Your view should look like figure 9.

figure 7

Lets move the object axis to the center of the body


object, click the Tools menu, and select Object
Property Editor, or use the keyboard shortcut, by
pressing F9 (Refer to figure 8).
figure 9

[44]
unitycreative

Now we need to break apart the wheels and save a


single wheel centered in the scene.

At the bottom of the list you should see group, click


on this object to unselect it, then click the Edit menu,
and select Delete.

Click the Object menu, and select Fragment.


Now you should be left with a single wheel that is
nicely grouped together.

Using the Top view, click and hold down the left
mouse button, then drag the cursor to encompass the
two front wheels. (Refer to figure 10)

All that is left to do now is to move the wheel to the


origin of the scene, 0, 0, 0, and centre the wheels
axis point.
First, make sure the wheel is selected, you can do
this by simply clicking on it in the scene view or in the
Hierarchy View dialog, then click the Move to button
on the left hand menubar.
Next, lets move the object axis to the center of the
wheel object, click the Tools menu, and select Object
Property Editor, or use the keyboard shortcut, by
pressing F9.
Now change the Loc x, y and z values to 0, and click
Close.

figure 10

Lastly, click the File menu, select Export, and then


select 3D Studio, click No to the Trial Version
dialog, type wheel in the File name field and click
Save.

Now click the Edit menu, and select Delete, now do


the same selecting and deleting one of the rear
wheels. You should now be left with one rear wheel.
(Refer to figure 11)

We now have our body and wheel 3DS files ready to


use in Unity!
Step 3 Import car model into Unity
Open Unity, and create a new project, make sure you
select the Scripts.unityPackage checkbox (Refer to
figure 12), now close Unity.

figure 11

Next select the remaining wheel by using the clicking


and dragging method, click the Tools menu, and
select Hierarchy View, or use the keyboard
shortcut F8, and click the Group button.
figure 12

Now click the Select all button, and use the scrollbar
on the left-hand side of the Hierarchy View dialog to
scroll to the bottom of the list of objects.

[45]
unitycreative

Then copy the following graphic files from the location


where you unzipped Porsche 997 GT3 rsr.3DS.zip
(which you downloaded in step 1), into your new
project Assets folder.

Step 4 Use A-Lab Softwares RapidUnity Vehicle


Editor to setup and drive car in Unity
Now we are going to use my Vehicle Editor to setup the
car within Unity, and take it for a test drive at runtime.

Wheel.dds
997_GT3.tga
CALIPER.tga
cpit.dds
DISC.dds
sw.dds
TIRE.tga
vitre_di.tga

If you do not have a copy of my Vehicle Editor, you can


purchase a copy from the following link at an exclusive
offer price to Unity Creative readers only, saving 20% off
normal price!
Download now for only $27 - http://www.alabsoft.com/
ucm_offer.shtml

Next copy both the body.3ds and wheel.3ds files you


created in the previous section into your new project
Assets folder.

Whether you already have a copy or you have just


purchased a copy of the Vehicle Editor, you now need to
import the three UnityPackage files that comprise the
Vehicle Editor in the following order.

Now re-open Unity again, and your Project panel


should look the same as figure 13.

UnityDefaultCar.unitypackage
UnityAdvancedCars.unitypackage
A
Lab_Software_RapidUnity_Vehicle_Resource_Pack_v1_
5.unitypackage

Once all three packages are imported, we can begin the


setup of the car with the Vehicle Editor.
First lets open the Vehicle Editor, click the Window menu,
and select Vehicle Editor. When you first open the Vehicle
Editor it will either appear blank, or display a message
(Refer to figure 15).
figure 13

Now drag both the body and wheel GameObjects


into the Scene view, and position both at the scene
origin, 0, 0, 0.

figure 15

figure 14

[46]
unitycreative

The reason this happens is because the Vehicle Editor


requires a vehicle rig GameObject in the scene.

OK, our car is almost ready to go now, except it does not


quite look right (Refer to figure 17), we now need to
adjust the wheel positions, and the box collider size and
position.

Within the Project panel, expand the A-Lab Software


RapidUnity Vehicle Resource Pack v1.5 folder, and click
the VehicleRig prefab, whilst holding down the mouse
button, drag the VehicleRig into the scene view.
Now with the VehicleRig selected in the Hierarchy panel,
click on the Vehicle Editor panel again, this time the
Vehicle Editor will display correctly (Refer to figure 16).

figure 17

First, change the Scene view to a Right view, now use the
Vehicle Editor Body Settings sliders to adjust the size and
center postion of the box collider.

figure 16

Next, move the VehicleRig prefab to 0, 0, 0.


Now change the size of both the body and wheel
GameObjects in the scene to a scale of 0.2 for x, y, and z
transforms. And rename them to custombody and
customwheel.

figure 18

Next, use the scrollbar at the side of the Vehicle Editor to


scroll all the way to the bottom of the panel, to view the
Wheel Settings parameters, use these sliders to position
the wheels in the correct position for the car body, and
also to adjust the wheel collider radius.

Now comes the fun part, make sure the VehicleRig is


selected in the Hierarchy panel, and click the Vehicle
Editor again, where it says Select a different body, use
the scrollbar to scroll the buttons to show the Custom
Body button, now click this button.

Tip, use both Right, and Front views to help you.


Do the same for the Custom Wheel.
You can safely delete the custombody and customwheel
GameObjects from the scene, as they are no longer
required.

[47]
unitycreative

Now download the following tarmac surface from the link


below, and save it as TarmacSurface,jpg in your project
Assets folder.

figure 21

http://www.alabsoft.com/images/TarmacSurface.jpg
Then drag this texture from the Projects panel in Unity
onto the Plane object in the scene, change the tiling x
and y values to 40 (Refer to figure 22)

figures 19 & 20

Thats it! the car is rigged and ready to go!

Step 5 - Test driving the car at runtime

figure 22

Now for the fun part, and when all your efforts are repaid!
First move the VehicleRig GameObject up on the Y-axis,
set transform position for Y to 3.

Now lets add a Directional Light, click the GameObject


menu, and select Create other, and select Directional
Light.

Next, add a Plane to drive about on, click the


GameObject menu, and select Create other, and select
Plane.

Change the position to 0, 0, 0, and set the X rotation


value to 60, then change the Intensity to 0.7.
Lastly, click Play, or Ctrl+P, and use the cursor keys to
drive the Porsche around in the scene.

Position the Plane at 0, 0, 0, and change its Scale to 20,


1, 20.

[48]
unitycreative

figure 23

figure 25

Ok, this is cool!

You can change the distance the camera is behind the


car, and also the height by modifying the Distance and
Height values within the Inspector panel for the
SmoothFollow script attached to the Main Camera.

Now stop the scene, lets setup the camera to follow the
car around.
Within the Project panel, select the Standard Assets
folder, Scripts, Camera Scripts and select and drag the
SmoothFollow script up and drop it onto the Main Camera
in the Hierarchy view.
Next, with the Main Camera selected in the Hierarchy
view, select and drag the VehicleRig GameObject from
the Hierarchy view down to the Target field of the
SmoothFollow script within the Inspector panel (Refer to
figure 24).

figure 26

Now try adjusting the slider bars at the bottom of the


Game view to see how the different parameters affect the
cars behaviour.
For instance if you pick up some speed and turn sharply
the car will roll, this is fine if you want this to happen,
however if you want to make the car more stable, you can
adjust the Centre of Gravity slider, moving all the way to
the left (a value of -1) makes the car almost impossible to
roll, and all the way to the right (a value of -0.1) makes
the car prone to rolling very easily.

figure 24

Now play the scene again, this is much better, now the
camera follows the car nicely!

You can always adjust the Tyre Slide/Drift to compensate


so that the car slides rather than rolls due to the tyres
gripping the road better.

[49]
unitycreative

Try setting the Centre of Gravity to the default -0.5, and


then Tyre Slide/Drift to 0.01, this gives you a really good
drift car!
Its really a simple case of trial and error, trying to find the
type of behaviour you want for your in game vehicle.
A smart feature within the Vehicle Editor is the ability to
save the slider positions, and then apply them to your car
rig within the Unity Editor, this is great because all
settings changed at runtime are lost when you stop a
scene.
Thats it I am afraid! Thanks for following my tutorial, and
I hope you have lots of fun creating your own driving
games with Unity!

[50]
unitycreative

<Code Snippets>
EventRouter

Player.js

Games are a complicated business. With all those


moving parts you're practically guaranteed that at some
point, things are going to get messy. One big problem
that often arises as your scenes get more complex is the
need for Game Objects to communicate with each other.
These Game Objects may not be related in any
particularly significant way, but none-the-less, must
communicate in the occasional situation. You have a few
options such as adding a public Game Object variable to
each script and use Unity's drag/drop functionality to hook
it all up, or making some sort of static class that keeps
references to all of your Game Objects, but both of these
come with their own problems and are rather messy as
your scenes scale up.

var moveSpeed : float = 5;


function Update () {
#
transform.Translate(Input.GetAxis("Horizontal") *
moveSpeed * Time.deltaTime, Input.GetAxis("Vertical") *
moveSpeed * Time.deltaTime, 0);
}
Next is the coin class which sends a message when it is
touched. The coin class also contains an enumeration to
be used as the event type. This is generally better than
using a string for the event which is easily typo'd.
Coin.js

A solution that keeps your code clean, but still gives you
the flexibility of having arbitrarily defined communication
between Game Objects ,is the idea of an event router.
Let us consider a very simple example of a scene
needing communication between Game Objects and then
see how an event router can solve this problem.

enum CoinEvent {
#
Collected
}
function OnTriggerEnter(collider:Collider) {
EventRouter.Publish(CoinEvent.Collected, this);
Destroy(gameObject);
}

- There are coins on the screen, when they are touched


they disappear
- The player can move around on the XY plane
- There is a GUIText displaying the current score
- The GUIText should be updated whenever a coin is
picked up

Finally we have the score display class which receives


the coin collected event and increase the score
accordingly.
ScoreDisplay.js

Using an event router, the coin could send a message


whenever it is picked up and the score could listen for
that message and update its text accordingly. The coin
and the score don't need to know about each other, they
communicate entirely through the event router. You could
then add new kinds of items that also send the same
message as the coin pickup and your score code wouldn't
need to be updated.

private var score : int = 0;


function Start() {
#
EventRouter.Subscribe(CoinEvent.Collected,
OnCoinCollected);
#
guiText.text = "Score: " + score;
}

The example Unity scene is named


EventRouterExample. It contains a Box for the player,
several instance of a Coin prefab and a GUIText that
displays the score. All of these have a script attached.

function OnCoinCollected(evt : EventRouter.Event) {


#
score++;
#
guiText.text = "Score: " + score;
}

First we'll look at the Player class which is controlled by


the keyboard.

[51]
unitycreative

<Code Snippets>
One last thing to note. Since the EventRouter is written
in C# you'll need to place it in your Plugins directory in
order to get everything compiled in the correct order. If
you're using C# in your project that's a non-issue.

make coroutines fairly easy to use, often I just want a one


liner to fire and forget my delayed method call. To make
this easier, the CusomExtensions namespace includes an
extension method that adds a CallMethodAfterDelay
method to the MonoBehaviour class.

============================
This means there's no need for a separate coroutine
method which is really handy to keep down the clutter in
classes that are firing off multiple delayed events.

The Typewriter class gives you a typewriter effect applied


to a GUIText GameObject. Simply set the text you want
written out and call the Write method to start the
animation.

The scene for this example is DelayedExecutionExample.


It contains one Game Object that has a script attached.
That script makes a copy of itself after a configurable
delay.

You can control the write speed, whether words are


broken at a certain number of characters or only on word
boundaries and you can disable the typing animation and
just show the text immediately if you only want the text
wrapping functionality.

DelayedCopy.cs
using UnityEngine;
using System.Collections;
using CustomExtensions;

Usage of the Typewriter class is extremely simple. Attach


the Typewriter class to a GUIText or set the
guiTextComponent propety to manually specify which
GUIText to use. If you look in the included example files
this scene is named TypewriterExample. Here is an
example class that sets up the typewriter's text and starts
the effect.

public class DelayedCopy : MonoBehaviour {


#
public float delay = 2;

WritePreamble.js

#
void Start() {
#
#
this.CallMethodAfterDelay(gameObject, "Clone", delay);
#
}
#
#
void Clone() {
#
#
var copy = (GameObject)Instantiate(gameObject);
#
#
copy.transform.Translate(Random.Range(-2f, 2f),
Random.Range(-2f, 2f), 0);
#
}
}

function Start() {
#
var typewriter = GetComponent(Typewriter);
#
typewriter.text = "We the People of the United States, in
Order to form a more perfect Union, establish Justice,
insure domestic Tranquility, provide for the common
defence, promote the general Welfare, and secure the
Blessings of Liberty to ourselves and our Posterity, do
ordain and establish this Constitution for the United
States of America.";
#
typewriter.Write();
}
Like the EventRouter, the Typewriter class is written in C#
so you need to place it in your Plugins directory to use it
from UnityScript.

There are some things to note here. First, this only works
with C#. Sorry UnityScript people but I don't know how to
get UnityScript to recognize extension methods.

============================
If you need to invoke a method at a later time usually
coroutines are your best friend. And while Unity does

[52]
unitycreative

<Code Snippets>
Second, you have to remember to stick the "using
CustomExtensions;" line in every file where you are going
to use these methods, even though they're technically
static, that's just how C# works.

I hope you will find them useful as well. If you have any
questions, comment, improvements, or suggestions
about these files, please contact me at
david@koontzfamily.org.
David Koontz
Happy Camper Studios

Third, notice the usage of this when invoking the


CallMethodAfterDelay method. This seems unneeded
but is necessary to correctly resolve the method, which is
a bummer.
============================
So that's it, three classes that I find very useful and use in
many of my projects (especially the EventRouter).

[53]
unitycreative

CREATING A SIMPLE
CHAIN ROPE

I.
II.
III.

Go to Reverie Interactive
website
(www.reverieinteractive.com).
Go to the downloads page by
clicking on the Downloads link
at the top of the website.
Choose whether you want the
Unity Package or the Files and
download the appropriate file to
its destination on your
computer.

Malesuada eleifend, tortor molestie, a fusce a vel et. Aliquam amet est class.
Installing the Unity Package:

Creating a more advanced chain:

Open Unity 2.6 or Unity 3.0


Right-click in your assets (Projects) panel and
select Import Package... (Fig. 0)
Go to where you downloaded or saved your file and
select the package (Fig. 1)
Make sure all the objects in the file are selected
and press Import (Fig. 2)
Your project's file structure should now look like

Opening the Rope Editor and Creating BASIC rope:

Go to the top of the window and select RI


Editors then select Rope Editor (Fig. 4)
Click Create new rope object (Fig. 5)
Your scene should now look like (Fig. 6)
This is the simplest form of rope to continue
with this type of rope just select a material for it
and place it in the Rope Material area and
press PLAY.

[54]

1. To create a chain using a prefab, click the Rope


Type drop-down and select Prefab (Fig. 7)
2. Select which prefab you want to use to make the
links in your chain. We selected the ChainLink
prefab which is in your DemoLinks folder inside of
your project window. (Fig. 8)
3. You might notice that the links are facing the wrong
direction. To get them facing the correct direction
change the Long Axis. We used the Y axis. (Fig.
9)
4. Sense the ChainLink prefab is a classic type of link
(unlike the UniqueLink prefab) we will need to
rotate every other link 90 degrees. To find out which
axis to rotate the link in you might need to play
around. For the ChainLink prefab we set X to 90
degrees. (Fig. 10)

Fig 2

5. We wanted our chain to be a little smaller and


longer so we decided to increase the detail of the
chain to 30 links. (Fig. 11)
6. Once we increased the detail it became difficult to
see the chain with the gizmos in place. We hid the
gismos by using a new feature in the Preview
Settings drop-down at the bottom of the editor and
unchecked the Show Gizmos property. This isn't
required but it make it a lot easier to see the links.
(Fig. 12)
7. The links were a little large so we used the Link
Scale setting to lower the scale down to 0.25 in all
three axis's. If you wanted to alter each axis
individually then you would have to un-check the
Link X,Y,Z property which would reveal all 3 axis's
for editing. (Fig. 13)
8. To give our chain a little more realism we wanted to
change our colliders from spheres to a more
appropriate shape. To see the colliders go down to
the Preview Settings area and check Show
Colliders. (Fig. 14)
9. Rope Script does not support Mesh Colliders so the
closest thing was Cube Colliders. The good thing
about the Rope Script's cube collider setting is the
ability to customize the colliders. Go to Collider
Type property and select Cube. (Fig. 15)

Fig 4

10. Once you enable the Cube Collider, you will notice
that it is far to large and does not match the links at
all. See our settings in (Fig. 16)
11. Now that your cube colliders more closely match
your links, you are finished. Go ahead and hit play
and enjoy your newly created chain! You can also
save the chain as a prefab and re-use it whenever
youd like in your scene.
Fig 5

Fig 0
Fig 6
Fig 1

[55]

Fig 7

Fig 9

Fig 8

Fig 10

Fig 11

[56]

Fig 12

Fig 13

Fig 14

[57]

Fig 16

Fig 15

Final

[58]

[59]
unitycreative

También podría gustarte