## Install

Add **Udonite Pens** from the listing. It brings [Udonite](/docs/compiler) and
[Networking](/docs/net) with it.

## Put a pen set in the scene

**Udonite > Pens > Create Pen Set** lays four slim pens (black, red, blue and green) and an eraser
on a tray in front of the Scene view. The first one also adds the scene's `PenWorld`, which holds
the ink.

Each pen is a `VRCPickup` with auto-hold, a kinematic `Rigidbody` and a `VRCObjectSync`, so it
moves for everyone while someone holds it. The meshes and materials are made once into
`Assets/Udonite/Pens`; restyle them there or swap in your own model under the pen.

## Try it

Compile, then **Build & Test** from the VRChat SDK panel with two clients and draw in one:

| | VR | Desktop | Phone |
|---|---|---|---|
| Pick up | Grab | Click; it stays held | Tap; it stays held |
| Draw | Trigger; ink at the tip | Left click; ink where you look | Hold Use and drag the view |
| Undo your newest stroke | Upper face button of the holding hand | R | |
| Erase | The eraser rubs out what its tip touches | The first stroke along your view | As desktop |

On desktop and phones ink goes onto a board you look at within 4 m, otherwise half a metre ahead
in the air. A tap leaves a dot.

A pen let go stays where it is. Set `returnAfter` on it to send it back to where you placed it a
few seconds after it is dropped.

## Pens of your own

Every pen's look is its `colour`, its `width` and an ink style: a template line on `PenWorld`
whose material, width curve and caps every stroke of that style copies, so any shader can draw ink.

```csharp
int neon = PensSetup.CreateInkStyle("Neon", neonMaterial, AnimationCurve.Constant(0f, 1f, 1f));
Pen glow = PensSetup.CreatePen("Pen Neon", Color.cyan, new Vector3(0f, 1f, 0f), neon, 0.008f);
```

`snap` puts every point on a grid for blocky, pixel-art ink. `drawInAir` off makes a pen that
draws only on boards.

## Clean up as you go

`PenWorld` keeps a pool of lines, 192 by default. When every line is in use the oldest stroke goes
for the next, so a room never fills up. `inkLifetime` fades ink after a number of seconds on every
client, and a [clear button](/docs/pens/boards) wipes boards or everything.
