Trouble adding a movement pattern

My script loops the game object up and down, but I would also like a constant force for it to move left. How can I implement it?

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

public class ysaucermove : MonoBehaviour {


    public float amp = 0.75f;
    public float freq = 1f;



    // Position Storage Variables
    Vector3 posOffset = new Vector3 ();
    Vector3 tempPos = new Vector3 ();


    // Use this for initialization
    void Start () {
        
        posOffset = transform.position;




    }

    // Update is called once per frame
    void Update () {


    
        tempPos = posOffset;
        tempPos.y += Mathf.Sin (Time.fixedTime * Mathf.PI * freq) * amp;

        transform.position = tempPos;



    }

}

Help, please!

Modify tempPos’s x value.

Now all the objects with the script are moved at the new X. Not working, I need something like velocity.

You’ll have to clarify what you mean. You wanted it to move left, now it’s moving left and you don’t want that any more? Try to be as clear as possible.

Make it move on the x axis… can be a += or -= depending on which direction you want.

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

public class ysaucermove : MonoBehaviour {

    public float amp = 0.75f;
    public float freq = 1f;

    // Position Storage Variables
    Vector3 posOffset = new Vector3 ();
    Vector3 tempPos = new Vector3 ();

    void Start () {
        posOffset = transform.position;
    }

    void Update () {
        tempPos = posOffset;
        tempPos.x += whateverspeedyouwantittomoveto;
        tempPos.y += Mathf.Sin (Time.fixedTime * Mathf.PI * freq) * amp;
        transform.position = tempPos;
    }
}