Unity: Raycast Reflection
Posted by Dimitri | Jun 29th, 2011 | Filed under Featured, Programming
As any person that has already used Unity’s Ray class knows, there’s no support for reflection, which could be useful for some specific cases. This post will try to offer a solution to that, explaining how to create a script which casts a ray that gets reflected when it hits a surface. Not only that, but the script also allows to set the number of times the cast ray should bounce. An example project with a scene and the code explained below is available for download at the end of the tutorial.
Before looking how the reflection script works, a scene must be set with some walls to reflect the ray. Additionally, a game object will be required to act as the source of the ray . To create the ray’s source, just select GameObject->Create Other->Cube: Continue reading: “Unity: Raycast Reflection”
Unity: Normal Walker
Posted by Dimitri | Jun 22nd, 2011 | Filed under Featured, Programming
This Unity programming tutorial explains how to create a controllable character that appears to ‘walk’ on the surface of another object. That’s achieved by using a script that matches the normal up orientation vector of the controllable game object with the surface normal of the other 3D object. But not only the script, this post also explains how to set up a scene to make it work.
A demo project with everything discussed here is available at the end of the post both in C# and JavaScript.
The first step is to create a Cube game object, that will act as your player. To do it, just select GameObject->Create Other->New Cube: Continue reading: “Unity: Normal Walker”
Unity: Rotation Controller
Posted by Dimitri | Jun 13th, 2011 | Filed under Programming
Another day, another Unity3D programming post. This tutorial contains not just one, but two scripts that rotates a game object around another one, based on the keyboard input. Again, like the previous tutorial, this was also inspired by retro games, such as S.T.U.N. Runner or the special stages from Sonic 2, where the player controls the main character by pressing left or right, making it complete a full circle in the screen. However, unlike those games, the below scripts aren’t applying gravity to the player, for the sake of simplicity. Everything explained here is available for download at the end of the tutorial.
Continue reading: “Unity: Rotation Controller”
Unity: Throttle Controller
Posted by Dimitri | Jun 8th, 2011 | Filed under Programming
This Unity programming tutorial will explain how to create a script that translates the containing game object forward at a pre-defined speed rate. This rate is controlled by a throttle much like the ones found in boats, planes or even trains. As usual, a Unity project with a working demonstration of this code is available at the end of the post.
The inspiration behind this tutorial came from the first Half-Life game, in which a train at the end of the tutorial level can have its velocity is gradually set by the player. Some of you may not remember how it looked like, so here’s a screenshot: Continue reading: “Unity: Throttle Controller”
Retro Review: Side Pocket (Genesis / Mega Drive)
Posted by Dimitri | Jun 5th, 2011 | Filed under Retro Games
This was one of the many pool games available back in the 90’s, released for almost every platform, ranging from the Arcade to the Game Boy. All Side Pocket versions were different in terms of graphics and music, however, the gameplay remained almost the same across the different gaming platforms. As one of the major 16 bit consoles at the time, the Genesis also received a version of this game, which is going to be the one this post is reviewing.
This isn’t your standard billiards game. In fact, Side Pocket‘s main mode called Pocket Game has its own rules, that are nothing like 9-ball, 8-ball, snooker or any other pool game played in real life.
Continue reading: “Retro Review: Side Pocket (Genesis / Mega Drive)”