CharacterSpawnProps
What a scene’s CharacterSpawn is given, and what each plugin’s onCharacterSpawn
reads as a character appears. A plugin adds its own fields by augmenting it:
declare module "@spawnite/engine" { interface CharacterSpawnProps { wardenClass?: string } }.
The body fields are hers at spawn: the physics cuts her capsule to them,
and the controller climbs, steps and jumps by controller.
Extends
Section titled “Extends”Partial<CharacterCapsule>
Properties
Section titled “Properties”| Property | Type | Default value | Description | Overrides |
|---|---|---|---|---|
abilities? |
readonly string[] |
undefined |
The abilities she holds for as long as she is in the world, by the names registerAbility gives them: a room refuses a cast of any other she holds from nowhere else, such as a worn item. Read by abilities(). |
- |
avatar? |
string | VrmBody |
undefined |
The body she wears, over a model or a primitive when none is named: a name registerAvatar registered, or the body itself. Every avatar plays the same clips. In a room only a name reaches the other pages, so a body handed as it is draws the placeholder there. |
- |
bagSlots? |
number |
16 |
How many slots her bag holds, in a game that lists inventory(). She wears the engine’s equipment slots too, and her bag and what she wears come back from the player’s save where the game’s save includes inventory. |
- |
children? |
CharacterOverlay |
undefined |
Drawn inside her model, so it follows her: a game’s bar over her head. | - |
clips? |
Partial<Record<ModelClip, string>> |
undefined |
The file’s own name for each of her model’s clips that is not named as ModelClip names it, such as { run: "Sprint" }. |
- |
clipSpeeds? |
Partial<Record<Walk | Run, number>> |
undefined |
The ground speed, in metres a second at the scale her model is drawn, at which its walk and its run play at their own pace, over the speed the engine measures off the model’s feet, such as { walk: 0.7, run: 2.15 }. Each must be positive, and the walk’s below the run’s. |
- |
collisionMask? |
CollisionMask | null |
every layer |
The layers its sweeps and contacts meet, null for every one. A chaser’s default leaves out both of the characters’ layers; a game lists characters.collisionLayers.players again for a body that blocks her. |
- |
color? |
ColorRepresentation |
blue |
The colour of her primitive. | - |
controller? |
Partial<{ floorSnapDistance: number; gravity: boolean; gravityScale: number; groundFriction: number; height: number; jumpHeight: number; maxSlopeRadians: number; platformOnLeave: PlatformOnLeave; pushes: CollisionMask | null; stepHeight: number; turnWithPlatform: boolean; }> |
undefined |
The character controller’s settings she starts with, each laid over its defaults: her step, her steepest slope, her jump’s height and the rest of CharacterControllerTrait. |
- |
facing? |
number |
0 |
Radians about y at spawn; zero is the rest direction. | - |
footsteps? |
readonly string[] |
undefined |
Files, ?url imports, one played at random each stride she walks. |
- |
health? |
object |
{ current: 100, maximum: 100 } |
Her health at spawn: full unless a save says otherwise. maximum is the base of her maxHealth stat. |
- |
health.current |
number |
undefined |
- | - |
health.maximum |
number |
undefined |
- | - |
height? |
number |
1.4 |
Metres above the feet the head stands. Never her model’s. | Partial.height |
marker? |
GroundMark |
GroundMark.Pulse |
What marks the ground where a walk ends: a pulse of light, a ring, another mark of light, or nothing. | - |
material? |
ModelMaterial |
undefined |
What her model wears in place of each of its materials, handed the one its file gave the mesh, such as a glowing shader over the file’s texture: the material her model registered with when left out. Read when her model loads and again whenever the function changes, so define it once outside the component. The material it returns is the game’s to dispose. |
- |
model? |
string |
undefined |
The name of a registered model she wears when no avatar is named. Where its file has clips, it plays the ones her pose asks for: idle at rest, walk and run blended by her speed, and jump off the ground, as ModelClip names them, and each clip playClip asks of her over them. |
- |
movement? |
Partial<{ acceleration: number; deceleration: number; maximumTurnSeconds: number; speed: number; standingShare: number; standTurnRate: number; turnAngle: number; turnInPlace: boolean; turnRate: number; }> |
undefined |
Her movement settings, each laid over the preset’s: her speed, how fast she gets up to it and stops, and how she turns, as Movement describes each. | - |
nameplate? |
NameplateSetting |
true |
The name over each other player’s head, never her own: the engine’s plate unless set, with a mic while that player speaks. false draws none, options tune the engine’s plate, and a component draws each plate itself from the same props, as Roblox’s name display and Fortnite’s nameplate settings let a creator do. |
- |
position? |
[number, number, number] |
[0, 0, 0] |
Where the player spawns. The first step stands the player on the ground. | - |
preset? |
"realistic" | "responsive" | MovementPreset |
MovementPreset.Responsive |
The movement settings she starts from: responsive unless named. Its value’s text too, so preset="realistic" reads as the enum does. |
- |
radius? |
number |
0.35 |
Metres from the axis to the side. Never her model’s. | Partial.radius |
resources? |
readonly ResourceKey[] |
undefined |
The resources she has, such as [mana], by the keys defineResource returns, each where its settings say it starts: her own, where a plugin’s resources gives one to every character. A cast whose cost names one she lacks is refused. Read by resources(). |
- |
respawn? |
false | RespawnOptions |
{ seconds: 5, at: RespawnPlace.Spawn } |
Whether she comes back once her health runs out, after how many seconds and where, as Roblox’s Players.RespawnTime sets it. With false she stays down, with the DownedTrait trait, for the game’s own flow to get up, such as a revive. |
- |
shape? |
"sphere" | "box" | "capsule" | PlaceholderShape |
PlaceholderShape.Capsule |
The primitive she wears when neither an avatar nor a model is named. | - |
stats? |
Record<string, { base?: number; modifiers: object[]; }> |
undefined |
Her stats at spawn, from a save: each stat’s base and its modifiers. The maxHealth stat’s base is health.maximum. |
- |
weapons? |
readonly string[] |
undefined |
The weapons she starts holding, by the names registerWeapon gives them, as Roblox’s StarterPack hands each player her tools: a room refuses a shot from any other from the moment she spawns. A game’s own system changes the list as she buys or swaps a weapon. Left out, she holds every registered weapon. Read by weapons(). |
- |