I want a 2d object to move one direction only without clicking a button or anything

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

public class BrokeEnviroment : MonoBehaviour
{
public float speed = 1;
public float movement = 1;
private Rigidbody2D rb;

// Start is called before the first frame update

void Start()
{
    rb = GetComponent<Rigidbody2D>();
}

// Update is called once per frame
void FixedUpdate()
{
    rb.AddForce(movement, speed);
}

}

Nevermind found the solution

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

[RequireComponent(typeof(Rigidbody2D))]
public class BrokeEnviroment : MonoBehaviour
{

public Transform target;

public float speed = 5f;

private Rigidbody2D rb;

// Start is called before the first frame update

void Start()
{
    rb = GetComponent<Rigidbody2D>();
}

// Update is called once per frame
void FixedUpdate()
{
    rb.velocity = transform.right * speed;
}

}