Control objects moving on a circular path mixing explicit position & physics engine
Suppose we have two carriages (let's call them 1 and 2) placed apart on a circular railway centered in (0,0). The user can touch and move each or both carriages with his fingers on a mobile device touchscreen. They are constrained to move only on the circle railway. Case 1 – carriage 1 is touched and moves by the user. As long as the finger touches the carriage, the carriage is following the finger very closely. In the end, If the user gives the carriage a slide forward or backward, the carriage continues until it stopped. Much like the glass of beer being slid on a bar. Case 2 – carriage 1 is touched and moves by the user. When the touched carriage collides with carriage 2, carriage 2 is moving by the physics engine. It is moving on the railways as long as carriage 1 is pushing. When Carriage 1 stops pushing, carriage 2 comes to rest following the laws of physics. Q1 – What is the correct way to force the carriages to move on a circular path in this scenario? Q2 – When the carriage is controlled by the finger the position has to be set by explicit geometry (finger location translated to near-by position on the circle) while when it is pushed because of collision it should be controlled by the physics engine. What is the correct way to solve this problem and how you suggest switching from one state to another?
Your answer
![](https://koobas.hobune.stream/wayback/20220613021915im_/https://answers.unity.com/themes/thub/images/avi.jpg)