Check out example codes for "player not following slide object unity 2d". It will help you in understanding the concepts better.

Code Example 1

Make Player as a child of collided object. Watch this video : https://www.youtube.com/watch?v=O6wlIqe2lTA&ab_channel=JasonWeimann

Learn ReactJs, React Native from akashmittal.com