Code that I copied directly does not work.

Can you try to link the execution line to “Released E”. Pressed is called every frame if you hold the button.