Talos docs

VehicleRecovery

Since 0.7

Automatic recovery: a vehicle flipped, stuck, fallen out of the world or drowned is put back where it can go on, and vehicle-recovered { entity, why, from, position } is raised (from: where it was before the move).

Plain text

Absent: none of it, and the vehicle behaves exactly as without the feature (ctx.vehicle.reset() still works); present, a field left out takes its default.

Fields

FieldTypeRequiredDefaultAllowed valuesDescription
flippedAfternumberno0Seconds upside down before it recovers, 0 or more; 0 is never. Defaults to 0.7. Upside down is its up axis below 0.35 of world up.
stuckAfternumberno1Seconds driven and getting nowhere before it recovers, 0 or more; 0 is never. Defaults to 1.6. Driven is throttle or brake held; getting somewhere is moving more than stuckSpeed x stuckAfter / 2 metres, or turning to a new heading.
stuckSpeednumberno2METRES PER SECOND, greater than zero: slower than this is getting nowhere. Defaults to 2. Measured over half of stuckAfter.
fellAfternumberno0Seconds falling before it recovers, 0 or more; 0 is never. Defaults to 0.25. Falling is no ground within 8 m below.
waterDepthnumberno0METRES of its chassis under water for 0.2 s before it recovers, 0 or more; 0 is never. Defaults to 0.6. Only in a scene with water, and never on a vehicle with a water block.
toVehicleRecoveryTargetnolastGood, road, uprightWhere it goes back to: lastGood (the default), road or upright. lastGood is its newest good spot. That is the newest spot at least 0.9 s old where it was on its wheels and upright. road is the nearest point on a road to that spot, facing along the road (lastGood with no road in the scene). upright is where it is, back on its wheels.
dropInSpeednumberno0The share of its speed before the trouble it is given back, forward, 0..1. Defaults to 0.5. Never more than half its top speed.
protectFornumberno1Seconds after a recovery with no new one and its spin damped, 0 or more. Defaults to 1.2.
guardbooleannotrueThe physics guard: runaway spins and launches are undone. Defaults to true. A spin over 20 rad/s is cancelled and a gain of more than 12 m/s in one tick is undone; a body that keeps doing it, or reads NaN, recovers.

See also