# WeaponWorldModel record

> The model everyone else sees in a weapon holder's hand, and the holder sees in third person: a record's worldmodel, either a model id or a table of model, bone, offset, angles, skin and body (In other people's hands).

Namespace `EvilEngine.Formats.Records`, assembly `EvilEngine.Formats`. Engine commit 4ff877b1.

```csharp
public sealed record WeaponWorldModel
```

The model everyone else sees in a weapon holder's hand, and the holder sees in third person: a record's `worldmodel`, either a model id or a table of `model`, `bone`, `offset`, `angles`, `skin` and `body` ([In other people's hands](/docs/plugins/weapons#in-other-peoples-hands)).

With no [Bone](#bone), a model that shares any bone with the holder's body by name, as Garry's Mod's `w_` models share `ValveBiped.Bip01_R_Hand`, is merged onto those bones and sits as its game holds it. Any other model sits on a bone of the body, [Hand](#hand) unless set, placed by [Offset](#offset) and [Angles](#angles). A body without that bone warns once and the model stays at its feet.

```toml
worldmodel = { model = "blaster:models/blaster", bone = "RightHand", offset = [0.02, 0.08, 0.03], angles = [0, 0, 90] }
```

## Members

### WeaponWorldModel (constructor)

```csharp
public WeaponWorldModel(ContentId Model)
```

Makes a world model of `model`, placed by bone merging or on [Hand](#hand), with the model's own skin and body groups.

### Hand (field)

```csharp
public const string Hand = "RightHand"
```

`"RightHand"`, the humanoid bone a model that isn't merged sits on when [Bone](#bone) is `null`.

### Model (property)

```csharp
public ContentId Model { get; init; }
```

The model drawn, from `model`, or the whole value when `worldmodel` is a plain id.

### Bone (property)

```csharp
public string? Bone { get; init; }
```

The bone the model sits on, from `bone`: a humanoid bone's name such as `RightHand`, `LeftHand` or `Chest`, or one of the body's own. `null` merges a model that shares bones with the body, and puts any other on [Hand](#hand). It can't be empty.

### Offset (property)

```csharp
public MapVector Offset { get; init; }
```

Where the model sits from its bone, from `offset`, in metres in the bone's own space. Zero unless set. Unused when the model is merged.

### Angles (property)

```csharp
public MapVector Angles { get; init; }
```

How the model is turned on its bone, from `angles`, as three angles in degrees about the bone's own X, Y and Z axes. Zero unless set. Unused when the model is merged. A bone's own space differs from rig to rig, so place a model on the bodies your players wear.

### Skin (property)

```csharp
public int? Skin { get; init; }
```

The model's skin, from `skin`, a whole number from 0 up, or `null` for 0.

### Body (property)

```csharp
public string? Body { get; init; }
```

The model's body group choices, from `body`, as a string of one digit a group, `"01"` for the second choice of the second group. `null`, or a group past the string's end, takes the group's first choice.

### Plain (property)

```csharp
public bool Plain { get; }
```

Whether only [Model](#model) is set, so the record writes it back as a plain id.
