Check out Half-Life Re-imagined competition results!
Check out Skewing textures in Hammer, our newest tutorial!
Say hello to Jongmeister, our newest member!


Site Stuff






Feeling Blue

What's your favourite shade of blue?














30 secs


2 mins


7 mins


12 mins


13 mins


15 mins


21 mins

Dr. Orange


A gaming and technology blog by TWHL admins Penguinboy and Ant. A music blog by TWHL users Ant and Hugh.

Perfect Timing with Doors

Page: 1 [2]

Tutorials > Half-Life > Intermediate > Perfect Timing with Doors


By Instant Mix (More from this user)
28th December, 2011
distance , speed , doors , trains
star star star star star (5 votes)

Perfect Timing with Doors - Page 2


In this example I've created an "odd door" , that being that the whole door compromises of two separate doors with different lengths.

Tutorial Image Sweet and simple.

The geometry is as shown :

Tutorial Image The dominant door , blue , and recessive , red , as shown.

Now as the lengths of the top section and bottom section are different , when both doors open , the bottom door will close before the top door closes. Unless you have a complex entity setup with the doors set to toggle , they won't open and close at the same time ( or arrive at the same time , for that matter ).

Tutorial Image This is shown at the bottom right corner of the Hammer editor ; it displays the dimensions of the selected object.

From the editor , we can see that our first door is 96 units high. To complicate this further , we have set the lip of this door to 16.
The bottom door is 48 units high , with no lip.
NOTE : It isn't always the height used , It's only because this doors moves vertically. The distance measured is relative to the direction.

We want our chunky door to take a nice 2 seconds to open up , so here we input these values into our two equations
D = 96
LIP = 16
T = 2
S = (D-LIP)/T
S = (96-16)/2
S = 80/2
S = 40

D = 48
LIP = 0
T = 2
S = (D-LIP)/T
S = 48/2
S = 24

When I plug in 40 as the speed of the blue door , and 24 as the speed of the red door , the two will now open and shut at the exact same time. Piece of cake!


avatar Daubster says: star star star star star 28th December 2011, 14:51 PM
I like how you've included a detailed example on how it all works, good stuff!
avatar DiscoStu says: 28th December 2011, 22:56 PM
Nice. Simple and to the point. Didn't learn anything new, though :P
avatar Tetsu0 says: 28th December 2011, 23:52 PM
Horray for math!
Nice Tut - Simple, easy to follow.
I used to not care about door timings, but now that i dont have to think for myself, i'm gonna apply it :)
avatar Captain Terror says: star star star star star 29th December 2011, 02:45 AM
this is really well done, and way faster than trial and error trying to match up the door speeds! Great work sir!
avatar SpaG says: star star star star star 31st December 2011, 08:50 AM
Now the only problem that remains, is calculating door height relative to the direction it will move, when doors move on a plane, or two axis (say, diagonally). Add more complex door shapes and you're better off guessing the timing :-D
Anyway, god work.
avatar Instant Mix says: 8th January 2012, 14:25 PM
I was going to add that in Spag but then I thought nobody would need it. Now that you've brought it up , I might just.
avatar Stojke says: star star star star star 22nd February 2012, 21:50 PM
Awesome! Really nice tutorial, 5 stars mate.
avatar ciba43 says: star star star star star 17th May 2013, 20:59 PM
Greatd tutorial :D
avatar BshiftCalhoun says: 26th May 2016, 23:24 PM
a more simplier way is putting a trigger_multiple next to the doors and make them big enough so the player doesnt reach the doors before it start opening (thats if you dont want to block on the doors when youre running)
avatar BshiftCalhoun says: 29th May 2016, 21:52 PM
nvm what i just said it has nothing to do with the tutorial my bad
You must be logged in to comment.