Random movement issue

Hi guys so i have my randomwalk script that assigns values on x,z. It works fine when on lvl ground but i want to be able to assign a y value for up and down but unless y is 60 or near he will not move. How can i get this script to work for x,y and z?

using UnityEngine;
using System.Collections;

public class randomwalk : MonoBehaviour {
    private Transform myTransform;
    private NavMeshAgent agent;
    bool sight=true;
    int search=0;
    bool ready=false;
    int randy = 0;
    float Addd = 0f;
    float Addd2 = 0f;
    int addd3=10;
    Vector3 Ad = new Vector3 (0, 0, 0);
    public Transform center;
    int randy2 = 0;
    int height=60;
    bool wander = false;
    void Awake() {

        myTransform = transform;
            }
    void Start() {

        agent = GetComponent<NavMeshAgent> ();
         
        //Debug.Log (center.position);
    }
 
 
    // Update is called once per frame
    void Update ()    { 
        wander = true;
        if (wander==false){return;}

        if (sight == true)
        {    randy = Random.Range (-300, 300);
            randy2 = Random.Range (-300, 300);
            sight = false;
            ready=true;
                }
             
        if (ready == true) { 
            Addd = center.position.x + randy;
            Addd2=center.position.z + randy2;
            Ad = new Vector3 (Addd, height,Addd2);
            agent.SetDestination (Ad)
            ready = false;agent.speed=2;
            }
     
     

        if ((myTransform.position.x - Ad.x < 10) && (myTransform.position.x - Ad.x > -10) &&
            (myTransform.position.z - Ad.z < 10) && (myTransform.position.z - Ad.z > -10)) {
            sight = true;
        }
     
    }
}

I’m not clear on what you want to do. Wouldn’t your Y value depend upon the height of the terrain the character is walking on? I wouldn’t think you’d set this randomly, but rather, by getting the height of the ground at the location the character and adjusting the Y value based on that.

Well i want to use this script for flying objects now and there y value will adjust. Also it irritates me that if a destination is (100,90,100) and my char is standing at (40,60,40) i cant give the destination to go as (100,90,100) but must do (100,60,100) this makes no sense.to me at least