Sunday, 14 February 2010

Unity Tutorials (Part Deux)

After I had completed the first tutorial (GUI essentials), I moved onto the next tutorial provided in the Unity documentation (called Scripting Essentials). The tutorial consisted of writing a javascript to make a light source target the First Person Controller, as if it were a moving spotlight. If the space bar is pushed, the target of the spotlight would change from the controller to a cube in the middle of the plane.

The second part of the tutorial involved writing a script that would instantise a cube prefab whenever the left mouse button was pushed, and setting its position to the current position of the First Person Controller.

Again, the tutorial was rather easy to work through, since using Unity is much easier than performing a similar process in XNA Gamestudio. The only major problems were getting the code right, but any mistakes were shown in the error log. The results can be seen below.

















No comments:

Post a Comment