How to create simple menu navigation and switch between menu screens in Unity

I’ve made a step by step video tutorial to create a basic menu and navigation script in Unity3D.

So basically you can see the Main Menu with two buttons to navigate to its sub menus, and in each sub menus you have a back button to go back to Main Menu.

In this video you will see how to switch between menu screens in one single Unity scene.

Enemy Patrol Starting from the Nearest and Closest Waypoint in Unity3D

I’ve created a simple C# script for Unity game that allows you to create a patrolling enemy around multiple waypoints (check points). It will start patrolling from the nearest / closest waypoint available around the patrolling object, then it continues to check the next waypoint incrementally.

Watch the tutorial video on my YouTube channel and please subscribe to support me 😀

How to add a Virtual Joystick in your Unity game easily

In this video I’m showing how to add a virtual joystick in your Unity by importing this package called MyJoystick.

See how to use this package in this video and have fun.

Here is the link to download the package, it’s from my Google Drive: https://drive.google.com/open?id=1KPUvXeJQw_XATMTY0QmF_4JE0-05sHQy

That is a Unity package. Drag and drop it to your Unity project to import MyJoystick. Find a sample test scene to see how it works. Everything is explained in above video.

Simple JavaScript function to capitalize first letter of a word

Hi! Previously I was searching for a way to capitalize the first letter of a word in JavaScript. I thought there is built in function/method in JavaScript to do that, but I didn’t find it.

So, here is a simple function that I’ve made.

function capFirstLetter(txt){
	return txt.charAt(0).toUpperCase() + txt.slice(1)
}

To use this function, just call the function with any word as its parameter that you want to capitalize its first letter. For example:

capFirstLetter("hello")

Then it will return “Hello” instead of “hello”.

How to generate random sentence consisted of random words with PHP

In this post I’m going to share a simple PHP script to generate random sentence consisted of random pre-defined words.

For example I want to show a text saying: “Hi, thank you for visiting my website” several times, but I don’t want repetitively saying exactly that sentence. Then the solution is this program, which can randomize some of words in this sentence so somehow it uniquely showing different sentences with same meaning.

To see the example please watch this video:

Silly PHP Number Encoder and Decoder Program

Imagine you are creating a PHP program and you can pass some number parameter in url to retrieve content from your server. Then maybe you are thinking if you let people seeing those numbers in their url, they can change that number to any number to retrieve another content.

This program can prevent that. Instead of using raw number as your parameters, you can convert those numbers into something silly that people don’t understand, only your server knows, so they will not play around with your program.

Silly PHP Number Encoder is a simple program to convert any number into scrambled string characters and converting that back to original number.

Watch demo video here:

You can get this program on my GitHub link here: https://github.com/habibieamrullah/sillyphpnumencdec

Tutorial on Creating HTML5 and JavaScript Load More Button

In this video tutorial I’m sharing about how to create “Load More” button in JavaScript to show partial contents of an array variable.

Please note that in this technique first I retrieve all the information from server at single shot and store it in single array variable. So load more mechanism is happening on client side, not each time calling server to return partial contents.

Watch this video demonstration:

I am using jQuery for this code, so you need to include jQuery first. And here is the actual code:

Creating Greeting Card Maker WebApp with Phaser

Phaser.js is a good library for creating HTML5 games.

However, this time I tried to use Phaser to make a greeting card maker web app.

Visit CardU a webapp that I’ve made recently. You can test it and see how it works.

Here I will share the source code of index.html and main.js files used in this web app:

How to move an enemy towards the player in Unity3D

When you make a game, you often need to make enemies that move towards the player.

In this video I’ll share some method to move an enemy object towards the player in Unity3D.

Watch this video to see how to do it by creating a simple script:

And here is the script used on this video:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class enemymover : MonoBehaviour {

    public GameObject player;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
        //transform.LookAt(player.transform);
        Quaternion targetRotation = Quaternion.LookRotation(player.transform.position - transform.position);
        transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, 1 * Time.deltaTime);
        transform.position += transform.forward * 1f * Time.deltaTime;
	}
}