Saturday, March 28, 2009

Unity3D: PhysicMaterial

The first thing I wanted to learn was how to use the PhysicMaterial and here's what I've found out.

To make a new PhysicMaterial you:

1. Assets > Create > Physic Material
2. I assume you have at most a sphere. If you do then click on it and look in the inspector. Under Sphere Collider you can find a Material drop down. Select the Physic Material you just created
3. There's a bunch of values you can tune and I'll leave that to the individual to mess around with. You can also read more about it in the documents

Now to access it through script you simply do the following:

this.GetComponent(Collider).material.bouncyness = 0;


or

colider.material.bouncyness = 0;


You can now script these values anyway you like. I had some help from the people on the unity3d irc channel. Thanks!

that's it! Now you can setup a project and bounce some balls around. Oh the joy of unity!

Thursday, March 12, 2009

Unity3d

So I've known about unity3d for awhile and I'm acutally working with a programmer on a unity project, but in 2009 I've decided to attempt my own personal projects with unity3d.

The idea is to go through some tutorials and try to create simple games. Currently I'm trying to figure out the physics material. I'll post more about my progress as I go along with some scripts.