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 () {
        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;

How to disable “Authentication Required” or “Sign In” Pop Up in wp-admin

Sometimes when I tried to login to my WordPress websites I see a popup asking me to sign in. Well, I tried to enter my WP username and password but it doesn’t work.

After googling around, I found a solution to disable that thing.

One of the solutions is to add this codes to .htaccess of the website:

<filesmatch "wp-login.php">
Satisfy Any

If you have same problem, I hope you can try it too.

Google Play and Apple Play Store Icon SVG Codes for Web Pages

The common way to display an image on a web page is showing image files by using <img src=”blabla.jpg”> tag.

But the problem is image files are not good enough if you scale up the web page, you will see the pixels.

It’s time to use SVG instead image files.

This codes I’m going to share here is SVG codes of Google Play and Apple Play Store icons. You can copy and paste it in your pages.

Preventing multiple same ElectronJS apps to run at single time

I am building an EelectronJS app and successfully release it as an executable Windows program.

But the problem is when the app is already running, if I double-click again that .exe file, the second window of this app is running, but buggy. I don’t want it. So here is the solution:

How to change WordPress footer text with JavaScript

There is a common way to edit footer text of a WordPress site theme, it’s by modifying footer.php file. But if you got a new update of your theme, you will lose that, the footer reverted back to the original footer file.

But if you put this a few line of JavaScript codes in your widget, no matter how often you update the theme, you will have your own custom footer.

In this video I’ll show you how to do it: