Code for the motioncast on MotionModel