Set a speed while on a conveyor

I want to make conveyor belts. I have managed to make it react when i hit the conveyor and it does move, but it accelerates when it goes onto another conveyor instead of keeping the same speed. Here’s the code:

void OnCollisionEnter (Collision collisionInfo)
{

if (collisionInfo.collider.tag == “Conveyor”)
{
Debug.Log(“We Hit Conveyor”);
rb.AddForce(0, 0, forwardForce * Time.deltaTime);
}
}

I dont want it to add the force, but rather keep the force the same even when it goes onto another conveyor.

What asset do you exactly work with in this case, your own, or from the store ?
Please, display the complete conveyor script so the community can have an input with the ideas, on your problem :).

I made my own asset and the script is on the object i want to move. Here’s the entire script:

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

public class IfHitConveyor : MonoBehaviour
{

public Rigidbody rb;

public float forwardForce = -500f;

void OnCollisionEnter (Collision collisionInfo)
{

if (collisionInfo.collider.tag == “Conveyor”)
{
Debug.Log(“We Hit Conveyor”);
rb.AddForce(0, 0, forwardForce * Time.deltaTime);
}
}
}

Nvm i got it working by changing the rb.AddForce to rb.velocity instead.

In the future, if you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

Thanks! i was wondering how to do that.