Starting Animation from random time frame Unity


Code snippet to start the animation at different time. Useful when there are many same animation running on screen and you want to make them random.

Animator anim = GetComponent<Animator> ();
AnimatorStateInfo state = anim.GetCurrentAnimatorStateInfo (0);
anim.Play (state.fullPathHash, -1, Random.Range(0f,1f));

You can add this code in Start or Awake function and add to the GameObject with the Animator component.

C# code to shuffle Array


private T[] ShuffleArray<T>(T[] array) {
    System.Random r = new System.Random ();
    for(int i = array.Length; i > 0; i--) {
        int j = r.Next (i);
        T k = array [j];
        array [j] = array [i - 1];
        array [i - 1] = k;

    return array;


Int Array

int[] intArray = new int[] {1,2,3,4};

intArray = ShuffleArray(intArray);

Float Array

float[] floatArray = new float[] {1.0f,2.0f,3.0f,4.0f};

floatArray = ShuffleArray(floatArray);

How to find the game art for your Game Project



I am currently working on a game development, i do programming and in the game if i require graphics then i hire designer. I was curious about how other indie developers like me manage the game assets. I asked in a Facebook group about this topic. Hopefully i got reply from Dozens of people. In this post i will share how they manage the game assets being a Game Programmer.

I will try to provide the link and their serious ideas to manage game art for your project.

  1. Some said that they would hire freelancer for entire art of their game.
  2. Some said that they would find free/open-source game art in the places like:,, GameArt2d
  3. Some said that they would buy the Assets from stores like: Unity Asset Store, GraphicRiver
  4. Some said that first they make a rough art and develop the game and eventually while releasing they would hire freelancer graphics designer.
  5. Some said that they have started to learn them self and they are doing great. Also some said that it is little easier to learn 8-bit style art. (2DGameArtGuru)
  6. Some said that they would partnership with designer to build the game and share the credit and earnings.
  7. Some said that they would just focus on game with art that is geometric shapes like square, triangles etc.

In this post i have shared the idea and link form my post thread only. There are many out there. I hope this will give you at least a basic idea for finding game art for your project.

Invisible Transparent Button in Unity3D

Today i was working on a project where i required to add the invisible button. I tried different methods like making button transparent, adding the image in the button. But then i came to know about this solution. I think that this is probably the best solution.

Steps to add invisible button in Unity3D

1. Add the Button. (UI -> Button)
2. Edit the height and width of the button according to your fit.
3. Delete the Image(Script) and the text from the button.
4. Create new C# script (Touchable.cs) and add the following code into it:

// Touchable.cs
using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
public class Touchable_Editor : Editor
{ public override void OnInspectorGUI(){} }
public class Touchable:Text
{ protected override void Awake() { base.Awake();} }

5. Add Touchable.cs script to the button.


Now you have the invisible button.

Source: UnityForum

Finally Graduated, I am an Engineer now

Hello all,

I have completed the Bachelor of Engineering in Software Engineering from Gandaki College of Engineering and Science (GCES), Lamachaur, Pokhara.

Recently on February 25th 2017, I had the convocation ceremony. The summary of this event can be found on my next blog. “Convocation Ceremony – Pokhara University“.

Graduation Photo

I would like to thank everyone for helping me through out this journey. Especially my Father, Mother and my brother.

This will inspire me to do more in my life for my country and for the world.

Thank You All!