I know this is quite basic, but I’m struggling to get it done. What I would like to do, is have it so that the player can open a door pressing the E key, and when the player presses the E key again, it closes.
For you request, one way to do it would be to not use states. You can keep state 1 the way you have it except just change your action playback type from Play to Ping Pong. Delete the State actuator. Make sure your player has Actor ticked in the physics type. It also may help to give your player a distinguishing property such as ‘player’ and have the Near sensor only detect objects with that property by putting ‘player’ in the property field of the Near sensor. Otherwise, the Near sensor will detect anything in its range that is set as actor(bullets, props, enemies, etc.) and that could cause unwanted results.
Sorry for not replying sooner, I got busy. But yeah what Sodsm_live said will work also.
I normally use a ray and a script to get the hit object and an expression to to interact with doors and pickups. But states should also work, they do for me.