Player sinking into plane

I have my player so that when i right click a target my character moves towards it but my cahracter is not only moves towards the target it’s sinking father an farther into the plane. When i looked at my character closely it looks like my character is trying to meets it’s middle ( his chest with) with the targets middle ( the middle of the cube) if you need more detail on whats going on just ask. heres my script.

using UnityEngine;
using System.Collections;

public class Rotation : MonoBehaviour 
{
    public Transform target;
    public int moveSpeed;
    public int rotationSpeed;
    public int maxDistance;

    private Transform myTransform;

    void Awake() {
        myTransform = transform;
    }

    // Use this for initialization
    void Start () {
        GameObject go = GameObject.FindGameObjectWithTag("Enemy");
        target = go.transform;
        maxDistance = 2;
    }

    // Update is called once per frame
    void Update () {
        //Look at target
        myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);

        if(Vector3.Distance(target.position,  myTransform.position) > maxDistance) {
            //Move towards target
            myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
        }
    }
}

i have a separate script that activates this script, and im programming in C# and i am very new to programming so i wont know many advanced terms Thanks in advance!

Your character will not detect collisions or obey gravity unless it has a rigidbody (hard to control) or a CharacterController. The easiest way is to add a CharacterController to it and move the character with SimpleMove - something like this:

    ...
    void Update () {
        // get the vector me->target - it will be very useful
        Vector3 dir = target.position - myTransform.position;
        // keep it horizontal to avoid character tilting if the heights differ:
        dir.y = 0;
        //Look at target using dir
        myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(dir), rotationSpeed * Time.deltaTime);
        if(dir.magnitude > maxDistance) { // dir.magnitude is the distance
            //Move towards target using the character controller
            GetComponent(CharacterController).SimpleMove(myTransform.forward * moveSpeed);
        }
    }

You just pass the speed vector to SimpleMove, and it automatically includes gravity. On the other hand, you can’t control the Y movement - use 2 if you need to jump, fly etc.