Skip to content

The player hero

For creators

A scene can give the player a hero seen over the shoulder: a body that runs, jumps, aims and fights, all set by tags on the scene. Signed in to MegaCity, players get the full hero on the reference body, which also crouches, climbs and holds guns by their grips. Signed out, they get a default body that runs, jumps and fights.

  1. In Blender, open Properties ▸ World ▸ Simulacrum ▸ Player and set Player to Third Person (add-on 2.2.2). With an older add-on, open Scene Properties ▸ Custom Properties and add player.controller with the value third.
  2. Add an Empty named Spawn where the hero starts. With add-on 2.2.0 you can also drag in the Spawn Point from the Simulacrum asset library, under any name. To start at another object, give its name in player.spawn.
  3. To give the hero weapons, add a weapons table. See Weapons.
  4. Press Play to try it. See Preview your scene.

The hero stands at the spawn with the camera over its right shoulder. A click captures the mouse.

Signed in to MegaCity Signed out
Body The reference body on the members’ clip set A default body (player.body) on its own clips
Speeds Run 3.5 m/s, sprint 6.0, walk 1.65, crouch 1.38, aiming 1.65 player.walk, player.run and player.aimWalk
Crouch, walk toggle, reload Yes No
Ledges, vaults and climbs Yes No
Guns Held by their grips, aimed at the crosshair; each shot and reload plays the body’s clip and the gun’s own A pistol held out in both hands, a rifle shouldered
A blow Flinches the upper body —

Signed in, the hero also:

  • faces where it runs, and faces the aim while aiming and for a moment after an attack. Moving one way while aiming another, it walks sideways or backward;
  • jumps, falls and lands. After 0.75 s or more in the air it lands hard and needs a moment before it moves on;
  • keeps its feet on the ground: on steps and slopes each foot finds its height and the hips drop to the lower one.

Both heroes pick things up and sit on seats with E.

The keys below are the defaults. The hero reads the scene’s own move, jump, run and fire actions, so a scene can bind them differently. See Controls for your scene.

Does Keyboard and mouse Gamepad Phone
Run W A S D Left stick Left thumb
Sprint Hold Shift Press the left stick Push the left thumb to the edge
Look Mouse Right stick Right thumb
Jump, climb, vault Space Bottom face button The scene’s on-screen jump button
Aim Right mouse button Left trigger —
Fire Left mouse button Right trigger The scene’s on-screen attack button
Swap weapon Q, the mouse wheel, or the weapon’s number key Top face button The scene’s on-screen swap button
Walk, on and off (signed in) V — —
Crouch, on and off (signed in) C Right face button —
Reload (signed in) R — —

A player can remap the hero’s own actions on the menu’s Controls page.

In a headset the player stands in the hero’s body. Their head and hands move its head and hands, the left stick walks it, and the right stick turns. Walls still stop it. See Headsets.

Signed in, Space facing a ledge climbs it instead of jumping. The hero must be on the ground, not aiming, not carrying anything, and facing the ledge.

Ledge height Standing or walking Running
0.3 to 0.8 m Steps up onto it Steps up onto it
0.8 to 1.4 m Climbs onto it Climbs onto it at a run
1.4 to 2.45 m Jumps to hang from the edge, then climbs up Climbs onto it at a run
0.4 to 1.3 m high and at most 0.9 m deep — Vaults over it

Below 0.3 m or above 2.45 m, Space is an ordinary jump. A climb needs 1.7 m of headroom and room to stand on top.

Ledges come from box-shaped level pieces: blocks tagged fps.block, objects with collision = box, and placed blockers. A building with mesh collision gives no ledges.

To try it, sign in to MegaCity and open ▶ the traverse course.

Add these to Scene Properties ▸ Custom Properties. With add-on 2.2.2, Properties ▸ World ▸ Simulacrum ▸ Player has fields for the most used ones: Player, Body, Start At, Health, Jump and Weapons at Start, and Add Setting for the rest. The × beside a field puts it back to its default.

Tag Values What it does
player.controller third Turns on the hero. Required
player.spawn An object’s name. Default: the object named Spawn (with add-on 2.2.0, the scene’s Spawn Point too) Where the hero starts
player.body A default body: biker, businessman-shirt, businessman-suit, businesswoman, female-coat, female-jacket, female-police, gamergirl, gangster, grandma, grandpa, hipstergirl, hipsterguy, hobo, jock, male-hoodie, male-jacket, male-police, punkgirl, punkguy, roadworker, shopkeeper2, summergirl, tourist; or none. Default male-jacket The body the hero wears when signed out
player.walk m/s. Default 5 Running speed, signed out
player.run m/s. Default 7.5 Sprinting speed, signed out
player.aimWalk m/s. Default 3 Speed while aiming, signed out
player.jump m/s. Default 5.4 Take-off speed of a jump
player.gravity m/s². Default -16 How fast the hero falls
player.radius m. Default 0.35 How wide the hero is when it bumps into things
player.health Default 100 The hero’s health, in a game that keeps it, such as the horde
player.sens Default 0.12 Mouse look speed
player.touchSens Default 0.3 Look speed with a thumb on a phone
player.weapons A table’s name. Default data/weapons.json The weapons table. See Weapons
player.weapons.start Weapon ids, comma separated, or none. Default: every weapon What the hero starts with
player.physio 1 or true A body with blood and wounds instead of hit points. See Bodies and injuries
player.moveX · player.moveZ Action names. Default moveX · moveZ The input actions that move the hero
player.jumpAction · player.runAction Action names. Default jump · run The input actions for jump and sprint
weapon.action An action name. Default fire The input action that fires
Tag Values What it does
camera.dist m. Default 3.4 How far behind the hero the camera rides
camera.height m. Default 1.55 How high it rides
camera.shoulder m. Default 0.55 How far to the right, over the shoulder
camera.aimDist m. Default 1.9 How close it comes while aiming
camera.fov Degrees. Default 62 The field of view
camera.aimFov Degrees. Default 48 The field of view while aiming

When a block stands between the camera and the hero, the camera moves in at once so it never looks through a wall, then eases back.

These are only the scene’s defaults. Each player’s own Camera settings in the menu win. See Menus and the dash.

Tag Values What it does
camera.turn snap (default) · smooth How the right stick turns
camera.snapAngle Degrees. Default 45 How far one snap turns
camera.vignette off · low (default) · high How much the view’s edges darken while turning or speeding up
camera.locomotion walk (default) · teleport With teleport, the trigger also teleports. The stick always walks

In a shared scene, other players see the body you wear. Signed-in players see a member’s reference body as it is; signed-out players see a default body in its place. See Playing together.

  • player.walk, player.run and player.aimWalk do nothing for signed-in players. Their speeds come from the clips.
  • Walk and reload have no gamepad button yet. V and R are keyboard only.
  • The hero does not turn in place. It turns its whole body as it moves.
  • A crouched hero walks forward only.
  • No climbing while aiming, carrying or in the air.
  • Every body climbs like a grown-up. The ledge heights do not scale with a body’s size.
  • In the horde, R reloads for signed-in players. After a game over they press Enter to play again.

To build a whole game around the hero, follow the tutorial The horde in third person.