S&box Wiki
Home
/
Edit Creating a Door
View
Edit
History
No Category
Developer Overview
The Project System
Publishing To Asset Party
Getting Started With Hammer
Mapping Basics
Mapping Entities
Advanced Mapping Techniques
Getting Started with Modeldoc
Animgraph & Animation
Physics
Modeldoc Nodes
Advanced Modelling
UI Basics
Styles & Stylesheets
Razor Templates
Game Menus
Materials
Built In Shaders
Shaders
Shader Reference
Sounds & Audio
Particles
Getting Started
Making Games
Input
Networking
Physics
Rendering
Editor & Tools
VR
Misc
Playing Guides
Console Commands & Variables
Dedicated Server
Log in to edit
Creating a Door
<cat>Hammer.Entities</cat> <title>Creating a Door</title> <deprecated></deprecated> This guide is a step-by-step tutorial to create a simple door. We are going to use [tools](Creating_your_first_gm_flatgrass#knowingyourtools) from Hammer. In S&box the doors are called **`ent_door`**. They are simple to use.🚪 # Making a door step-by-step ## Step 1: With the **Entity Tool** ( <key>SHIFT</key> + <key>E</key> ), create a new ent_door. You can search or choose the Entity Class: `ent_door` in the *Tool Properties* window. You can also create an entity *(like a `prop_static`)* and change class. <upload src="a768a/8da71e14bcb2184.png" size="774190" name="step-1.png" /> ## Step 2: You can now edit Object Properties. Select the **Objects** ( <key>5</key> ) mod and select the door. You can see the window objects properties lower right corner. You can have a bigger window by double-clicking on the entity. You can verify the class of the object in "*Class*". Choose a name for a door and set a "*World Model*". You can put the name of the model or use the *magnifying glass* <key>🔍</key> in the right corner. When you see the door on the preview, you can see that the door is now on your map. Change the position of the door if you need to fit it with the **Move Tool ( <key>T</key> )**. <upload src="a768a/8da71e16485635c.png" size="811419" name="step-2.png" /> ## Step 3: Now we are going to make the opening animation. You can choose a `Rotating` door or a `Moving` door. Change to the type you need. - A **"`Rotating`" door** is a door that rotate on an axis. The animation is like when you use the rotating tool around the origin. - A **"`Moving`" door** is a door that move in a direction. The animation is like when you move the door using the move tool on an axis. Now we are going to set the "Distance". It's the amount that the door can make in the opening animation. - **For the Moving door:** The amount, in inches, of the door to leave sticking out of the wall it recedes into when pressed. Negative values make the door recede even further into the wall. - **For the Rotating door:** The amount, in degrees, that the door should rotate when it's pressed. In our example, we want to make a rotating door that open to an angle of 90 degrees. Put The movement type to "Rotating" and the distance to "90". The door is now functional, you can see a blue block next to the door that shows what the door can do. *`Note: Step after this one are optional`* <upload src="a768a/8da71e17d3d9997.png" size="728656" name="step-3.png" /> ## Step 4: We are going to add details. I want a door that opens slowly. In **"Speed"**, put *150*. By default, the speed is *100*, you can speed up or slow down the animation by changing the number. I want a door that closes itself after 10 seconds. In the **"Auto Close Delay"**, I put *10*. You can change this delay if you want the door to close quickly or slowly. The amount of time is the seconds after the door has opened before it closes automatically. If the value is set to *-1*, the door never closes itself. ## Step 5: If you test it, you are going to see that the door is silent. We are going to add sounds. Go to the **"Sounds"** category and expend it with the <key>+</key>. Choose a sound by clicking on the *magnifying glass* <key>🔍</key> to the right. You can hear the sound by clicking on the play button <key>▶️</key>. | Name | Description | |------|-------------| |**Start Opening Sound**|*Sound to play when the door starts to open.*| |**Fully Open Sound**|*Sound to play when the door reaches its fully open position.*| |**Start Closing Sound**|*Sound to play when the door starts to close.*| |**Fully Closed Sound**|*Sound to play when the door reaches its fully closed position.*| |**Locked Sound**|*Sound to play when the door is attempted to be opened but is locked.*| |**Moving Sound**|*Sound to play while the door is moving. Typically this should be looping or very long.*| For the example, I choose sounds from the UI. ## Step 6: If you want a double door or connected door, there are two ways to make them. Create another door and put it where you need it. 1. If two doors have the **same name**, Source think it's the same door. Rename your second door with the name of the first. They are now connected. 2. In the **"Other Doors To Open"** section, put the name of the other door. Do this for the two doors, and they are now connected. *`Note: For the second door, if you want to open it in the same direction as the first, you probably need to rotate it and put a negative value for the distance`* <upload src="a768a/8da71e20628227d.png" size="607268" name="step-6.png" /> # Result When you use <key>E</key>, you can see your door working. <upload src="a768a/8da58676ee80577.mp4" size="4166296" name="result_single.mp4" /> <upload src="a768a/8da586785b06a35.mp4" size="4629444" name="result_double.mp4" /> Learn more about door here: <page>Hammer.DoorHelperAttribute</page> Learn more about ent_door in s&box: [Reimagining Base Entities](https://sbox.facepunch.com/news/aug2021#ReimaginingBaseEntities)
S&box Wiki
Development
Developer Overview
6
Editor Overview
General FAQ
System Requirements
The s&box wiki
Troubleshooting
Useful Links
The Project System
4
Adding Assets
Creating a Game Project
Project Settings Window - Games
Project Types
Publishing To Asset Party
2
Uploading assets
Uploading projects
Hammer
Getting Started With Hammer
3
Getting Started With Hammer
Making Your First Map
Mapping Resources
Mapping Basics
7
Cordons
Hotspot Materials
Selection Sets
Standard Mapping Dimensions
Tool Materials
Tools Visualisation Modes
Using Entities That Require a Mesh
Mapping Entities
2
Creating a Door
Light Entities
Advanced Mapping Techniques
8
Collaborating With Prefabs and Git
Instances
Prefabs
Quixel Bridge Plugin
Tilesets
Tilesets-Advanced
Tilesets-Proxies
VIS Optimizations
Models & Animation
Getting Started with Modeldoc
7
Automatic Model Setup
Breakpieces
Creating a Model
Guide to Models
Importing Rust Weapons
LODs
ModelDoc FAQ & best practices
Animgraph & Animation
4
Animations without Animgraph
AnimEvents, AnimGraph Tags, Attachments
Animgraph
Delta Animations
Physics
3
Cloth Physics
Collisions, Physics & Surface Types
Jiggle Bones
Modeldoc Nodes
1
Custom ModelDoc nodes
Advanced Modelling
6
Bodygroups
Citizen
First Person
IKChains and Stride Retargeting
Morphs
Vertex Normals
User Interface
UI Basics
6
Custom Fonts
Embedding Websites
Enabling Pointer Events
Events and Input
UI Basics
UI with Components
Styles & Stylesheets
1
Video Backgrounds
Razor Templates
4
A Razor Overview
Aliases and SetProperty Attributes
Generic Components
Templates
Game Menus
1
Making a Custom Pause Screen
Materials & Shaders
Materials
5
Guide to Materials
Material Attributes
Material Resources
Texture Settings
Using Dynamic Expressions
Built In Shaders
2
Foliage Shader
Glass Shader
Shaders
4
Compute Shaders
Constant Buffers
Material API
Shading Model
Shader Reference
5
Anatomy of Shader Files
Getting rid of Tex2D macros
Shader Reference
Shader States
Texture Format Cheat-Sheet
Other Assets
Sounds & Audio
4
Guide to Sounds
Sound Events
Sound Occlusion
Soundscapes
Particles
5
Creating animated sprites
Creating your first particle effect
Understanding Particle Editor
Using custom sprites
Using particle systems from C#
Coding
Getting Started
5
Cheat Sheet
Learning Resources
Setting up Rider
Setting up Visual Studio
Setting up Visual Studio Code
Making Games
2
Components
GameObjects
Input
4
Commands
ConVars
Input System
Speech Recognition
Networking
7
Auth Tokens
Http Requests
Lobby System
Networked Types
Networking Basics
RPCs
WebSockets
Physics
5
Collisions
Hitboxes
Joints
Traces
Triggers
Rendering
3
Render Tags
RenderHooks
Scenes
Editor & Tools
5
Guide to Widgets
Hammer API
Hammer Gizmos
Hotload Performance
Widget Docking
VR
3
Getting Started
VR Input
VR Overlays
Misc
10
Asset Types
Attributes and Component Properties
Backend API
Code Accesslist
CPU Performance Profiling
DisplayInfo
package/find
Setting Up A Navigation Mesh
Threaded Tasks
TypeLibrary
Playing
Playing Guides
3
Default Keybinds
Proton
s&box on macOS (Experimental)
Console Commands & Variables
1
Launch Arguments
Dedicated Server
1
Dedicated Servers