How to buid an unicursal maze by using Blender game logic
Hi, all. I am trying to build a unicursal maze as a my dissertation project by using Blender. I have a door and a player in the game, and my main goal is once the player pass through the door, close the door,and avoid to open the door again if the player tries to pass back again from the opposite side of the wall.I have set a animation of door which open and close it, and also set a game logic using near sensor and action actuator.
However, as far as using this function, the door open when the player comes back to the door from the opposite side.
So I would like to ask you to tell me how to realize this.
Or any python code would be also appreciate for it.

I have attached a screen shot of my case, and I would like receive your help into how should I configure the sensors and actuators for this case?


I would tie the state of the door to a property.
if character near and property closed==False, then close the door and property closed== True.

if i have understand well python is not necessary :slight_smile:
since can be solved “physically”
or using a ray(+Y) on the door
or making the door a sensor and using a object (children) that keep far the player from the door sensor.
so, the door has collision (and can be open) only if the player come from one side

doorwithoutpython.blend (105 KB)

flipper mode work perfectly for this case

Hmmmm,it might be little bit difficult for me to understand without any tutorial video, because I am very begginer of BGE. Anyway, thank you very much.

Thank you Monster, your idea of (a) seems to be what I’d like to do. By the way, do you know how to remove the openers automatically after player passed through it?

Removing is very simple. The tutorial shows you how it triggers the open and close. The same way you can activate an endObject actuator. The opener will disappear.

But, as the openers are on both side of the door. You might end the opener on the other side as well, just by walking over it.

To end the opener only when the door is closed (as they will be open when you just left) a feedback from the door is needed. This is currently not mentioned in the tutorial.

A simple workaround:
I guess you are using sliding doors. In difference to the tutorial it means the door will not slam the character when it is in swing area. You can mount (parent) the opener at each side of the sliding door wing. This way the character can open a door by (nearly) hitting the door, dependent how thick the opener is. With the above method, you end the opener after usage.

left opener -----
door wing =====
right opener -----

While the door slides open the opposite opener will be out of the way and not be touched by the character. This way the character can cross the door from the opposite once more.

Does that help?