Skip to content

MovementClaim ​

Inherits: RefCounted

What something asks of the movement of an entity: a movement volume that is around it (water, a weightless room), an effect that lets it fly. An entity can have several claims at once: the one with the highest mode decides (flying over swimming over walking; of two equal ones the later wins). A claim that only changes the speed (wading through shallow water) has the mode Ground.

Description ​

Add one with Entity.add_movement_claim and take it away with Entity.remove_movement_claim(source).

Variables ​

Objectsourcenull
ModemodeMode.GROUND
floatspeed_multiplier1.0
floatvertical_speed3.0
IdleBuoyancyidle_buoyancyIdleBuoyancy.HOVER
floatsurface_yINF
floatfloat_depth1.0
floatsurface_stop_depth0.6
boolallows_surface_leapfalse
boolfollows_camera_pitchtrue
boolvertical_controltrue
Vector3flow_velocityVector3.ZERO
Stringfootstep_surface""
Stringfootstep_swim""
FlightLogiclogicnull
booluse_air_animationstrue
Stringanimation_override""
intpriority0

Enumerations ​

enum Mode ​

How an entity moves: on the ground (gravity, walking), swimming (free 3D movement, the swim animations) or flying (free 3D movement, nothing pulls it down).

  • GROUND = 0
  • SWIM = 1
  • FLY = 2

enum IdleBuoyancy ​

What an entity that gives no vertical input does in a free movement mode: stay where it is, rise to the surface, or sink.

  • HOVER = 0
  • FLOAT_UP = 1
  • SINK = 2

Variable descriptions ​

Object source = null ​

Who made the claim (taken away with it). Anything: a volume, an effect

Mode mode = Mode.GROUND ​

The movement mode the claim asks for

float speed_multiplier = 1.0 ​

What the claim does to the speed on the ground and in the water (1 = nothing, 0.5 = half)

float vertical_speed = 3.0 ​

How fast the entity moves up and down in a free mode (units per second)

IdleBuoyancy idle_buoyancy = IdleBuoyancy.HOVER ​

What an entity does when it gives no vertical input

float surface_y = INF ​

The height of the surface (world y) that FLOAT_UP rises to and that the entity cannot rise through. INF = no surface (the air, a weightless room)

float float_depth = 1.0 ​

How far below the surface the feet of a floating entity are (so the head is out of the water)

float surface_stop_depth = 0.6 ​

How far below the surface an entity swimming up is stopped (it can leap out of the water from there)

bool allows_surface_leap = false ​

Can an entity that swims up to the surface leap out of the water (jump)?

bool follows_camera_pitch = true ​

Does an entity moving through this follow the camera up and down (look up and move forward to rise)?

bool vertical_control = true ​

Can the entity steer up and down (jump, crouch and the camera pitch)? A boat cannot: it floats on the surface

Vector3 flow_velocity = Vector3.ZERO ​

How fast the water or the wind carries the entity (a river, a current), in the world, metres per second. It is added to how the entity moves, and the claims add up

String footstep_surface = "" ​

What the ground sounds like to the entity while it is in this (the kind of ground of its footsteps: "water", "mud", the words of the folders of your footstep sounds). Empty = no say: the ground under it decides

String footstep_swim = "" ​

What the ground sounds like to an entity that SWIMS in this ("water_deep"): the sounds of its strokes, and of jumping into and out of the water. Empty = the footstep surface above, else "water"

FlightLogic logic = null ​

The logic that shapes the velocity of the entity while this claim decides (momentum, a glide: see FlightLogic). Null = the entity moves as it asks

bool use_air_animations = true ​

Play the flying animations while this claim decides (they fall back to the swimming ones when an entity has none). Only used with the mode Fly

String animation_override = "" ​

The name of one animation that plays instead of all the swimming or flying ones while this claim decides (a floating pose). Empty = none

int priority = 0 ​

Of two claims with the same mode the one with the higher priority wins (of two equal ones, the later). A mount is 10, a volume 0