MultiConnectSDK › Physics
3. Components
Physics Space
MCPhysicsSpaceComponent is the world. Its child objects take part in it, and it runs the simulation for you.
| Field | Default | What it does |
|---|---|---|
| Gravity | 0, -9.81, 0 | The pull on every dynamic body |
| Fixed Hz | 60 | Simulation steps per second |
| Steps Per Fixed Update | 1 | Steps run in each Unity FixedUpdate. Set Fixed Hz to Unity's fixed rate multiplied by this |
| Solver Iterations | 8 | Higher means stacks and contacts are more accurate, and cost more |
| Position Iterations | 3 | How firmly overlapping bodies are pushed apart |
| World Bounds Half Extents | 1000 each | The size of the world |
| Broadphase Cell Size | 2 | Set it to about the size of your larger moving bodies |
| Linear and Angular Damping | 0.02, 0.05 | How quickly motion fades on its own |
| Sleep thresholds | 0.01 | Below these speeds, a body goes to sleep and costs almost nothing |
| Max Linear and Angular Speed | 200, 50 | Safety limits |
| Position Slop | 0.005 | Overlap left between touching bodies, in metres. Lower it for small objects |
| Ccd Speed Factor | 0.5 | Lower it if fast bodies pass through thin walls |
| Sync Mode | Off | See Multiplayer |
| Headless Mode | Off | Turn it on for a server with nothing to draw |
Rigid Body
MCRigidBodyComponent makes an object move. Put it on a child of the Physics Space, with a collider on the same object.
| Field | What it does |
|---|---|
| Body Type | Dynamic moves by forces. Kinematic moves only when you move it. Static never moves |
| Mass | Its weight |
| Center Of Mass | Moves the balance point, for example to make something hard to tip over |
| Lock Pos, Lock Rot | Stop movement or rotation on an axis |
| Material Override | Its material |
| Start Asleep | Starts resting until something hits it |
| Snapshot Id | A stable name, for objects that move around the hierarchy |
Colliders
A collider gives an object its shape. A collider with no rigid body becomes fixed scenery.
| Component | Main fields |
|---|---|
| MCSphereColliderComponent | Radius |
| MCBoxColliderComponent | Half Extents, which is half the width, height and depth |
| MCPlaneColliderComponent | Normal Local, One Sided |
| MCCapsuleColliderComponent | Radius, Half Height, Axis |
| MCCylinderColliderComponent | Radius, Half Height, Axis |
Every collider also has Layer, Is Trigger and Material.
Materials
A material decides how surfaces feel. Create one with Assets > Create > MultiConnect Physics > Physics Material.
| Field | Default | What it does |
|---|---|---|
| Static Friction | 0.6 | How hard it is to start sliding |
| Dynamic Friction | 0.4 | How much sliding slows down |
| Restitution | 0.2 | Bounce: 0 is none, 1 keeps all its speed |
| Rolling Friction | 0.01 | How quickly rolling slows down |
| Spinning Friction | 0.01 | How quickly spinning on the spot slows down |
| Friction Combine, Restitution Combine | Average | How two touching materials are combined |
Other components
| Component | What it does |
|---|---|
| MCTriggerComponent | Tells you when bodies enter or leave a zone. See Script 4.3 |
| MCRaycasterComponent | Finds what is along a line. See Script 4.4 |
| MCCharacterControllerComponent | A ready-made walking and jumping character. See Script 4.5 |
| MCBodyRenderInterpolator | Smooths a visible object between physics steps. Set Source to its rigid body |
| MCStaticColliderComponent | Marks a parent of fixed scenery, and passes Layer and Material to its child colliders |

