Table of Contents

Class ObservedMotion

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

What a client reads off a character it only watches: whether it swims or climbs, from where it is. Another player's movement never runs on this client (state forwarding is off; its NetworkTransform places it) and an NPC's runs only on the server, so nothing tells this client what they are doing. Their body is animated from what can be seen instead, with the movement's own thresholds, so a watched swimmer swims where the swimmer itself does.

public static class ObservedMotion
Inheritance
ObservedMotion
Inherited Members

Remarks

Nothing goes on the wire for it. Crouching cannot be seen this way (the capsule's height is not synced), so a watched character never crouches.

Fields

ClimbSlack

How far past where a climber hangs a watched character may be and still be on the climbable, metres.

public const float ClimbSlack = 0.25

Field Value

float

GroundProbeHeight

How far over the feet the ground below is looked for from, metres.

public const float GroundProbeHeight = 0.3

Field Value

float

GroundTolerance

How far under the feet ground still counts as stood on, metres (a capsule's skin and a step's lip).

public const float GroundTolerance = 0.15

Field Value

float

Methods

OnClimbable(in SceneClimbable, Vector3, float)

Whether feet at feet are on climbable: across the ground within a climber's hang of its line (its half width, a body's radius of radius, the hang clearance and ClimbSlack), and between its foot and its top.

public static bool OnClimbable(in SceneClimbable climbable, Vector3 feet, float radius)

Parameters

climbable SceneClimbable
feet Vector3
radius float

Returns

bool

Swimming(bool, float, float, float)

Whether a watched character swims, from the still water over it (stillWater, NaN for none) and its feet: in at SwimEnterSubmersion of its height under the surface, out under SwimExitSubmersion, as KCCController decides it, so wading at the depth between keeps whichever it was.

public static bool Swimming(bool wasSwimming, float stillWater, float feetY, float capsuleHeight)

Parameters

wasSwimming bool
stillWater float
feetY float
capsuleHeight float

Returns

bool