Source SDK

Source SDK

Marmot Jan 5, 2017 @ 10:23am
How do you make doors with padlocks? (Half-Life 2)
I've always loved breaking padlocks in Half-life 2, and I want to make a door with one for myself. But I haven't been able to find a single tutorial or guide regarding padlocks.

How do they work? Do you just shove it on a door handle as a physics prop? Do you need constraints or something? :steamsad:
< >
Showing 1-2 of 2 comments
Wazanator Jan 5, 2017 @ 11:13am 
Check the prop type in hammer but I want to say it's meant to be physics.

Anyway the way you would do it is place the padlock model where you want it to be and name it something like padlock_mdl. Have motion start disabled. Select the door and name it and have it start locked. Create a brush that's textured with invisible and then turned into a func_breakable and set the health as well as the gib type. This will be the padlocks hitbox. In the outputs tab of the func_breakable have OnBreak -> padlock_mdl -> Break as well as OnBreak -> padlock_door -> unlock.

You can just do all of this in the prop_physics that is the padlock but having the func_breakable lets you better define the area the player can hit.
Marmot Jan 5, 2017 @ 2:19pm 
Originally posted by Wazanator:
Check the prop type in hammer but I want to say it's meant to be physics.

Anyway the way you would do it is place the padlock model where you want it to be and name it something like padlock_mdl. Have motion start disabled. Select the door and name it and have it start locked. Create a brush that's textured with invisible and then turned into a func_breakable and set the health as well as the gib type. This will be the padlocks hitbox. In the outputs tab of the func_breakable have OnBreak -> padlock_mdl -> Break as well as OnBreak -> padlock_door -> unlock.

You can just do all of this in the prop_physics that is the padlock but having the func_breakable lets you better define the area the player can hit.

Thank you very much, man. I appreciate your help.
Now it's time to put padlocks on every door I see!
Last edited by Marmot; Jan 5, 2017 @ 2:20pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Jan 5, 2017 @ 10:23am
Posts: 2