Wouldn’t you want it so that if you clicked the door it opens, and when you clicked it again it closes?
Anyways, there’s a ton a ways you can achieve this, the easiest being with an IPO and, of course, python. I’ll make you a quick example.
Basically, we need to grab the objects that are near the player object, and the easiest way to do that is with python. I won’t explain the code (because you just said you’re a beginner) so I suggest you look up some python tutorials because making an FPS is freakin’ impossible without the flexibility of coding.
So here’s the example,
WASD to move.
door_example.blend (443 KB)
I’ve made it very simple for you, so you can use it with no python skills at all.
Make sure the player object has two properties, one called “doors” and the other called “door_max_dist”. In “doors” (this is a string) you type in the property that all your doors will have (this is so the player knows what’s a door). In the “door_max_dist” you type in the distance you want to be able to sense doors from (leave this as a float or integer). To run the script, connect an always sensor (with true pulse) to a python controller in module mode, and type in “door.main”
Then just make sure to copy the setup on from door object to door object; the properties and the logic bricks. You only need to setup the player once and the length of the door animation doesn’t matter.
Try it out!
The above post is good too, but I still suggest my method because it’s way faster to do once you have the initial setup done, and you don’t have to touch the door.
Oh, and here’s another example of the door closing when you’re too far away… I thought that’d be useful too.
door_example2.blend (446 KB)