It has rightly been said that the day without learning something new is a day that has gone waste.

First things First, Have you ever wondered about the games that are made based on the TRON movie? We see some cool bikes with flashing trails following them. That is remarkably unique in its own way.

In terms of common language, we call them a WOW EFFECT, but coming in terms of UNity, It is a LineRenderer.

“The line renderer is used to draw free-floating lines in 3D space.

This class is a script interface for a line renderer component.”

using UnityEngine;
using System.Collections;

public class LineScript : MonoBehaviour {
     /// The line renderer component that is attached to the gameObject.. 
     LineRenderer lineRenderer;
     /// The cube that we are finding in the scene. ///

     GameObject cube; // Use this for initialization 
     void Start () { 
         lineRenderer = gameObject.GetComponent<LineRenderer>(); 
         //the cube that is in the scene has beeen assigned the tag as a player. 
         cube = GameObject.FindWithTag("Player"); 
         //It has two indexes by default. The initial point denotes the Index 0, and the 
         //final point(of the line renderer) denotes the index 1 
         lineRenderer.SetPosition(0, cube.transform.position); 

         //Set the width of the line renderer. 
         lineRenderer.SetWidth(0.5F, 0.5F); 

     void Update() { 
        //the end position of the line will follow the player where ever it goes. 
        //This is the effect that I am talking about. 
        lineRenderer.SetPosition(1, cube.transform.position); 


So, another script will be attached on the cube which will move in a direction..

      //Cube script. Attach this script to a cube and give it a tag name "Player" via the inspector.
         bool canMove = false;
	// Update is called once per frame
	void Update () {
             canMove = true;
			transform.Translate(Vector3.right * Time.deltaTime * 10f);
        //Stop the movement of the cube.
        //So, The player will stop moving and you can see a pretty good trail.
        // If you want a fancy one, then attach a pretty decent material to it.
	void StopMovement(){
		canMove = false;	

So, after a lot of hard-work(Pheww) we’re finally done with Line Renderer part. Let me show you a screen shot. Of course with a fancy material.



Hope this will help you.

Sid ;)

Well, So here I am again at your service. Haha, just joking. So you might be wondering what this post is all about, eh?

Many people are in the habit of avoiding long searches to find the best available solution/link for a particular problem. Well as a beginner, we all are normally confused on how a particular thing can work, so we just start googling (a jargon for me, btw) for solutions. Sadly, the same was for me when I stepped up into Unity3D.

Normally, a good developer or a designer is a person who saves the references/links that might come into handy for himself  at any point of time( just to avoid the searching time). So I (actually me and my colleague) did the same thing. We shared the sheet containing links to some awesome posts on Unity3D and so I am sharing with you all.

Here are the links, Don’t get dizzy though, the links are simple and easy to understand:—unity-animation-samples……;    ***collider tree ***    ****github***    BACKGROUND IMAGE……;    animation    ***fade in fade out skybox******    *****bg image*****    ****important*****    ******splash screen Code******    ****shooter game…    ***bubbles help****    *****mesh vertex calculate*****    /****Action Pattern*****/

********main menu **********    *****SKYBOX******    ****Water Effect    ***Shader**    ***saving & loading data ****    **slope

********************game play    ******runer Game***Ship    ***********SAVE DATA**********    *****shader    *****Php\    ********Unity Coder…

A Star Algorithm References*_search_algorithm

So I hope these all will be useful to you which ultimately will reduce your search time.

Sid ;)

Well here I am for yet another exciting post on Unity3D. Today I’ll be telling you how to restrict the player’s movement in a particular range. I’ll be doing it here for the X-Axis and Y- Axis. You can do the same for Z-axis too. Its not that difficult. I’ll assume that you have at least some basic knowledge of Unity Scripting. For more detailed information, you can refer to the Unity3D scripting references. Before beginning, Unity is all about a 3D Vector, since the objects are represented as 3D vectors in real space. Here, Vector3 Comes into play.

GameObject ball;
void Start(){
        ball = GameObject.FindWithTag("Ball");   //Find the game object in the scene whose tag is "Ball".

// If Player's X exceeds minX or maxX..

if (ball.transform.position.x <=minX || ball.transform.position.x >=maxX)
    // Create values between this range (minX to maxX) and store in xPos
    float xPos = Mathf.Clamp(ball.transform.position.x, minX + 0.1f, maxX);

    // Assigns these values to the Transform.position component of the Player
    ball.transform.position = new Vector3(xPos, ball.transform.position.y,0);

// If Player's Y exceeds minY or maxY..
if (ball.transform.position.y <= minY || ball.transform.position.y >=maxY)
    // Create values between this range (minY to maxY) and store in yPos
    float yPos = Mathf.Clamp(ball.transform.position.y, minY, maxY);

    // Assigns these values to the Transform.position component of the Player
    ball.transform.position = new Vector3(ball.transform.position.x, yPos,0);

So this is how it works. I’ve attached the links with the code. So that it works fine and If you’re having any problems with it, you can  just click on the highlights.


Sid ;)

Yes, it has been said truly that Unity3D is a powerful game engine which works on a simple principle – “Code at one place, and deploy to various places (platforms namely PC, Web, Android, iPhone namely iOS).”, which I thought that its a myth. BUT its true.

So during these four months i’d developed two games in unity3D, and have gone viral in the public market. Hope those two spread like an epidemic.

You can check these out form the following links.

1.) Cave Runner HD


Play on Facebook. Do like the Fan page.

Here are some game play scenes from the game.

2.) Penguin 3d Racing : Cube Wars

      Go to Market

Get Penguin 3D racing on Google Play Store.

Penguin 3d Racing. Get it on Google Play Store


So I hope you’ll love these two flicks that I’ve made and I’ll continue to make more and more.


Sid ;)

Hi all, now I’ve been migrated to Unity3D to make high end 3D games, so i guess its now a farewell to OpenGL ES? Hmm, well I guess so, NO because OpenGL ES is just for your knowledge on how things work at the back-end and what are the basics behind a particular scene. For example, To draw a cube programmatically , you need to define the co-ordinates of the vertices and have to choose what kind of triangles you need to use(plain old triangles, triangle strips or triangle fans), sounds hectic, right? I guess so yes, because my reaction was like a BIG Question MARK on my face.

So, let me tell you what exactly Unity3D is,

Unity is a rich 3D game engine for creating interactive content.
The exciting thing about Unity 3D is the speed and efficiency. It is simple to set up, it runs quickly in a browser and across platforms including Windows, Mac, Android and iPhone/iPad as well as games consoles and it allows us to develop for all these platforms from a single source.

This means, all i have to do is code at one place and deploy it simultaneously to iPhone, Android, PC, Mac etc. Quite a relief to all my folks having the iPhone.

You have three options n which you want to do the programming, basically scripting, namely C#, Java Script and Boo.

Since I am comfortable with java, so i’ll do my scripting in C# only. Hardly matters as most of the syntax is the same.

I’ll be posting most of my work from unity here so I guess it would be helpful to all.


Sid ;)

In openGL ES, there are 3 fog modes that are available to us. These are displayed in the table below :

Flag Description

  • GL_EXP This is the simplest form of fog. Objects do not really appear to move in and out of the fog. This just creates a simple haze effect.
  • GL_EXP2 This is a more advanced version of the previous fog mode. Objects now appear to move in and out of the fog . You may notice that the fog does not appear completely realistic as a distinct line  can be seen at the point where the object is moving out of the fog.
  • GL_LINEAR This is the most realistic fog mode. Objects appear to come in and out of the fog properly, giving a realistic fog effect.
gl.glEnable(GL10.GL_FOG); // 1. to enable the fog
gl.glFogf(GL10.GL_FOG_MODE, GL10.GL_EXP2); //2. set the fog mode.
gl.glFogfv(GL10.GL_FOG_COLOR, fbbb); // 3. to set the fog color, it takes a framebuffer value.
gl.glFogf(GL10.GL_FOG_DENSITY, 0.1f); // 4. density of the foggy fog</span></span></p>

This function allows you to specify how important the look  speed of your effect is.
The first parameter can be a number of values such as GL_FOG_HINT, GL_LINE_SMOOTH_HINT,      GL_PERSPECTIVE_CORRECTION_HINT and GL_POINT_SMOOTH_HINT.
We will only be dealing with the GL_FOG_HINT flag.

The second parameter can be either GL_DONT_CARE, GL_FASTEST or GL_NICEST.
If we want our fog to look as good as possible, we would pass on GL_NICEST.
If we are concerned more with speed, we would pass on GL_FASTEST.
The default value is GL_DONT_CARE.
This will enhance the effect of the fog only if there is enough time to do so.

We pass GL_DONT_CARE onto the glHint function below.
This is not necessary as this is the default value anyway.
We are showing it here just so that you know that you can increase the fog effect further.

gl.glFogf(GL10.GL_FOG_START, 10.0f); //near and far distances
gl.glFogf(GL10.GL_FOG_END, 15.0f);

Well to use a framebuffer object in the line 3, you can refer this function. It takes a float array and returns a FB Object.

float fogColor[] = { 0.5f, 0.5f, 0.5f, 1.0f }; //a fog of gray color is used here,
//you can change the values and create fog colors as per your need.
FloatBuffer fbbb;

public MyRenderer(Context context) // the renderer class constructor
this.context = context;
fbbb = makeFloatBuffer(fogColor);

protected static FloatBuffer makeFloatBuffer(float[] arr)
ByteBuffer bb = ByteBuffer.allocateDirect(arr.length*4);
FloatBuffer fb = bb.asFloatBuffer();
return fb;

The above example is working fine.


Sid ;)

Happy New Year 2013

Posted: December 31, 2012 in Coding
Tags: , , , , ,

Well, First of all i’d like to say hello to all of you out there reading my post.
2012 is ending and to be frank with you, it was a period of ups and downs. But the best part is that I work what I love and I Love what I work.

I’d like to wish all of my readers a very happy and a prosperous new year 2013.

According to me, New Year is not just full of resolutions and wishes and promises etc etc… But it is the joy, inner peace, strength and the melodious tune that makes us forget even the worst of the times that we stumbled upon.

After all, its the new year, So party hard.

Live like a King and Party like a Rock Star.

Happy New Year 2013. Welcome it with a Blast.

Happy New Year 2013

Sid ;)