[SOLVED] When character is re-enabled movement is wonky

Hello, all,
I have a chair that when you touch the seat it disables the character and enables the camera for the spaceship. I have it set up so if you press r, it turns back on the character and disables the ship camera. I did some testing and when I press WASD while the ship’s camera is enabled to move the ship, then press R to go back to my normal character all my controls are messed up. For some reason, if I only disable the player and enable the ship camera, then press R to disable the camera and re-enable the player, movement is fine.

Im sorry if its a bit wordy. Any help would be appreciated!

Hi, we need more information, could you provide a link to the project or demo?

Sure. PlayCanvas 3D HTML5 Game Engine Scene is mainspace. All you have to do is touch the chair seat to enable the ship cam, and press R to re-enable the character once you are in the chair. If the number on the right reaches 0 you won’t be able to move anymore, you can just reload. If you give me your user name I can add you to the project,

When you rotate the ship, you change the axes of the ship, but not the player, you must orient the axes not on the rigidBody. The rigidBody does not rotate.

Thanks for letting me know! how would I orient the player correctly? setEulerAngles? or just setRotation to something completely different?

https://playcanvas.com/editor/code/1243038?tabs=191961099,195988932

Line 33:
this.player.setPosition(this.playergoto.getPosition());
add:
this.player.setRotation(this.playergoto.getRotation());

I tried that and didnt work, I even tried setting the rotation to the ship and that didn’t fix it.

I fixed it. For some reason the problem was that the player was a child of the ship. Once I made it a child of the root it worked fine.