I'm creating a space exportation game. In this game you can run around the ship and do repairs, decorate, etc. however as the ship can rotate in 3D space I want players to stick to the floor as if by artificial gravity, I've decided to use an Area3D (which replaces gravity) for this but i need the player's rotation to match the gravity direction so that its down direction is equal to the gravity direction.
similar to the game "portal" where the player is rotated to match the down direction without changing where the player is looking, except that the gravity's down direction could be any direction.
how do i do this?