@Andres_Gomez, I am not sure I am following the exact system you are wanting to make as the ice cream cart sounds like procedural motion where the example you show of the trucks is a predetermined animation path. The road has several options to choose from when it splits, but the trucks must stay on the road and cannot simply drive where they want.
I have two examples I can share to start and encourage you to ping back with more questions if these aren’t quite what you are looking for. The first one is a more procedural motion solution where you are creating the end point and speed of the animation dynamically, being able to interrupt the motion as needed.
This is a fictional product page showing how to integrate a Babylon canvas into a web site. As you can see as you scroll down the page, the position of the HTML content will drive the animation of the device. The code for the example is available in GitHub for you to experiment with. You can see in this example, we are creating a animation every time we move the object or animate a parameter. The animations can be interrupted (if you are scrolling quickly down the page) so that the new animation take the mesh’s current position into account. This would be the approach I would take for a scene entirely driven by procedural motion.
The other option would be if you had a predetermined animation path that your asset follows like in the truck example. I would bake those animations in Maya, and then group them by segment of road. Each group would have a start/end that lines up with either a split in the road or another point at which the truck needs to stop. You can then sequence the animations as you like just by calling play or stop on the animation group associated with the specific truck. You would either clone one of each possible animation group for each truck, or you could clone and dispose of the current animation group that each truck should be playing at any given time. This second option would limit the number of groups in a scene at any given time to the total number of imported groups plus one additional group per truck in the scene.
There was another thread I replied to today that was talking about sequencing animations. This isn’t quite what you are doing, but you can see in the playground example how we are sequencing from one animation group to another using observables. This allows us to know when one animation group ends and we can then either randomly choose another group - in the case of choosing a fork in the road - or timing out before playing the next clip - in the case of pausing for the truck to be loaded.
I hope these examples give you some ideas, but please feel free to ping back and ask more questions if I did not understand the scene you are trying to make correctly.