S&box Wiki
Home
/
Edit Joints
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
Joints
<cat>Code.Physics</cat> <title>Joints</title> <note> This page is a work-in-progress. More sections and fact-checking are needed. </note> #Overview A PhysicsJoint constrains the motion of one PhysicsBody relative to another. If a PhysicsBody is dynamic, any joints attached to it may influence its movement. For example, consider two cubes connected by a SpringJoint. Each cube has a BoxCollider component that defines its shape in the PhysicsWorld, along with a Rigidbody component that provides a dynamic PhysicsBody for the collider to attach to. <upload src="b5b0a/8dd52968aed2311.png" size="374443" name="sbox-dev_iwL4qnCs3S.png" /> When the first cube is pulled, the second follows behind due to the spring force. <upload src="b5b0a/8dd5296a7683d96.mp4" size="2463129" name="sbox-dev_K4rfX0LwHg.mp4" /> If a body is static or keyframed, joints will not influence its movement. However, any dynamic body connected to the same joint may still be affected. <upload src="b5b0a/8dd5296d6b84b7f.mp4" size="1999227" name="sbox-dev_SqT0w7uEAL.mp4" /> #Joint Components In the Scene Editor, PhysicsJoints can be created by adding a Joint Component to a GameObject. Each type of joint provides different movement constraints, which are described below. <note> A **joint component** does not need to be on the same **GameObject** as the **Rigidbody**. This allows for offsets, such as hinges positioned away from the connected bodies. <upload src="b5b0a/8dd52996a0e2cb1.png" size="1018" name="sbox-dev_FWWnEuAMNx.png" /> </note> in C# you can use the Attachment property to control what reference frame the body uses. If you use Joint.AttachmentMode.Auto, the joint will maintain the position and rotation at the time of attachment. Joint.AttachmentMode.LocalFrames will make the joint connect at the center of it's attached rigidbody. ##Fixed Joint A FixedJoint welds two physics objects together, keeping them at a fixed distance while also maintaining their relative rotation. <upload src="b5b0a/8dd52973efa6a25.mp4" size="2463871" name="sbox-dev_WYoWbVnx19.mp4" /> Frequency and Angular Frequency control the stiffness of the joint. ##Spring Joint A SpringJoint tries to maintain a set distance between two objects. <upload src="b5b0a/8dd5297edcba8f5.mp4" size="2460659" name="sbox-dev_4Gzv6raAGO.mp4" /> Frequency controls the stiffness of the spring. Min Length defines how close the objects can get before being pushed apart. Max Length defines how far they can separate before being pulled back together. ##Slider Joint A SliderJoint constrains movement to the Z-axis relative to the connected body, similar to a drawer opening and closing. <upload src="b5b0a/8dd52989003768c.mp4" size="3619407" name="sbox-dev_83qLsVfXrv.mp4" /> Min Length and Max Length define the range of movement along the axis. ##Hinge Joint A HingeJoint allows two physics objects to rotate around a single axis, like a door hinge. <upload src="b5b0a/8dd5299789c51ad.mp4" size="2028143" name="sbox-dev_yZFCGqDsyn.mp4" /> ##Ball Joint A BallJoint fixes two objects together while allowing rotation in any direction, similar to a shoulder joint. It supports optional twist and angular limits. <upload src="b5b0a/8dd5299e2768506.mp4" size="2251277" name="sbox-dev_w9jXj8YEGk.mp4" />
S&box Wiki
Development
Developer Overview
7
Community Council
Editor Overview
General FAQ
System Requirements
The s&box wiki
Troubleshooting
Useful Links
The Project System
5
Adding Assets
Creating a Project
Getting Started With Libraries
Project Settings Window - Games
Project Templates
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
6
Cordons
Hotspot Materials
Selection Sets
Standard Mapping Dimensions
Tool Materials
Tools Visualisation Modes
Mapping Entities
1
Light Entities
Advanced Mapping Techniques
7
Collaborating With Prefabs and Git
Instances
Prefabs
Tilesets
Tilesets-Advanced
Tilesets-Proxies
VIS Optimizations
Models & Animation
Getting Started with Modeldoc
7
Automatic Model Setup
Breakpieces
Creating a Model
Importing Rust Weapons
LODs
ModelDoc FAQ & best practices
Overview of Models
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
5
Custom Fonts
Embedding Websites
Enabling Pointer Events
Events and Input
UI Tips & Tricks
Styles & Stylesheets
1
Video Backgrounds
Razor Templates
2
A Razor Overview
Aliases and SetProperty Attributes
Game Menus
1
Making a Custom Pause Screen
Materials & Shaders
Materials
5
Material Attributes
Material Resources
Overview of Materials
Texture Settings
Using Dynamic Expressions
Built In Shaders
2
Foliage Shader
Glass Shader
Shaders
5
Compute Shaders
Constant Buffers
Material API
Shader Learning Resources
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
Overview of Sounds
Overview of Soundscapes
Sound Events
Sound Occlusion
Particles
5
Creating animated sprites
Creating your first particle effect
Understanding Particle Editor
Using custom sprites
Using particle systems from C#
Coding
Getting Started
4
Learning Resources
Setting up Rider
Setting up Visual Studio
Setting up Visual Studio Code
Making Games
2
Components
GameObjects
Input
2
Input System
Speech Recognition
Networking
3
Lobby System
Networking Basics
Networking Cheat Sheet
Physics
5
Collisions
Hitboxes
Joints
Traces
Triggers
Rendering
3
Render Tags
RenderHooks
Scenes
Editor & Tools
7
Hammer API
Hammer Gizmos
Hotload Performance
NavigationView
Overview of DebugOverlay
Overview of Widgets
Widget Docking
VR
3
Getting Started
VR Input
VR Overlays
Misc
8
Asset Types
Attributes and Component Properties
Backend API
Code Accesslist
CPU Performance Profiling
package/find
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