public class Conveyor : MonoBehaviour
{
public float speed = 1f;
Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
Vector3 pos = rb.position;
rb.position += -transform.forward * speed * Time.fixedDeltaTime;
rb.MovePosition(pos);
}
}
Reference: https://www.youtube.com/watch?v=hC1QZ0h4oco
Top comments (0)