Player pushing mining cart along its track

I want to let player push a mining cart along its rail tracks, how do I do that with JS?

I would do it like this:

Add a box collider to your minecart which is a bit longer than the minecart is.

then you make a script where you add the function OnCollisionEnter()
in this function you add a force to your minecart. this way the cart should go forward when something gets close to it… so entering the collider.
Hope this works i didn’t tried it myself.

GL.