how to create an animation with dimension changing along a path?

Dear Grab user,
I've never done an annimation with SW(2019). I would like to create one with one dimension that need to be capture during the animation.
Can somebody explained me how to add a dimension that will update while moving the part?
Sensor is an option but I've no idea how to display it inside the animation.