How do I change the gamemode when I press E in a trigger box?

The method you are looking for isn’t necessarily a change of game mode but a change of input on the character. If I understand you correctly, you are looking to ignore move and look inputs. Here is a setup that I use in my game.