I created some new materials for both the door frame and the door segment materials.
I wasn't sure of the best way to add the doors into my level. I could add them individually to the level as part of the level geometry so the level was complete, or I could add nodes that would be spawned/replaced with doors.
I opted to go with door spawning:
Just need to apply some scaling to get it to fit the entire corridor.
The object I was using to represent the door in my level was a 1x1x1 cube, but the door I have created is not 1x1x1 in dimensions. So I adjusted the placeholder object so it would scale properly:
Not exactly what I was hoping for, but fixable.
The other problem I was attempting to solve was how to store Door metadata. I am still treating Blender as a level editor, so why not make it the place where these things are defined.
This allows me to configure everything in Blender, and then it will be read by my game to configure things like the door frame material, if it's locked, requires a key, or how many segments it has.
A door with "3 segments" is just a 2 segment door that opens horizontally, whereas the one with 2 segment is the one that opens vertically. I worked on readjusting the segment materials and updated my game so that it would randomly select a door frame material and a segment material.
I also attempted to indicate that if a door requires a specific key, by adding a colour to the material:
It doesn't look great, but I figured I would solve it later. The other issue I wanted to address was how you opened the door, previously you had to collide with the door for it to open. I added an additional area before/after the door that allows the door to open before you intersect with it.
Just entering the purple zone will open the door.
Having doors that open properly and have random material selection allowed me to create a hallway of doors:
Which looks like this:
My own version of the Get Smart intro.