Player not staying on moving spaceship

Im making this space game and when you flip a swich on the spaceship it should start moving forward and then the player can move around the spaceship while the spaceship is moving. I got the spaceship to move but the player wont stay on the moving spaceship but the ship moves under the player. Ive been searching for answer but everybody says that i should just set the player as spaceship’s child but its not working.

Also when i set the player as the spaceship’s child the players movement gets reversed

Finally found out the solution!! I just had to check Auto Sync Transforms in Project Settings/Physics

Yeah, parenting the player to the spaceship should do the job. If that is not happening then something else must be going on. My guess is that you are changing players position and not localPosition since now he is a child so you have to use localPosition. This can lead to strange behaviour. If its not the case then provide a screenshot of your hierarchy and the player movement script.