how to apply a force in direction of object is facing?

this relates to train question

I am building a simulator for pieces of track so a sphere will move within and follow track shape any answers

You can use rigidbody.AddRelativeForce

To apply a force in the object's own forward direction, you can use the transform.forward variable, like this:

AddForce( transform.forward * forceAmount );

However, this alone won't necessarily keep your object on its tracks!