TraceHit
Defined in: client/api.d.ts:6400
The first blocking hit of a World.lineTrace.
Properties
Section titled “Properties”
readonlyactor: {class:string;name:string; } |null
Defined in: client/api.d.ts:6449
The actor hit. Names are this client’s own and differ between clients; don’t send them to compare.
readonlybone:string|null
Defined in: client/api.d.ts:6459
The bone hit on a skeletal body.
component
Section titled “component”
readonlycomponent: {class:string;name:string; } |null
Defined in: client/api.d.ts:6454
The component hit.
distance
Section titled “distance”
readonlydistance:number
Defined in: client/api.d.ts:6424
Distance from start to the hit, in centimetres.
entity
Section titled “entity”
readonlyentity: {id:number;type:"beast"|"player"|"npc"|"worldObject"|"character"; } |null
Defined in: client/api.d.ts:6469
The replicated entity whose body was hit, with its network id; null for the level and anything else not replicated.
impactNormal
Section titled “impactNormal”
readonlyimpactNormal:Vec3
Defined in: client/api.d.ts:6419
Surface normal at the impact point: up for flat ground, the wall’s facing for a wall.
impactPoint
Section titled “impactPoint”
readonlyimpactPoint:Vec3
Defined in: client/api.d.ts:6409
The point on the surface that was hit.
levelObject
Section titled “levelObject”
readonlylevelObject:string|null
Defined in: client/api.d.ts:6464
The LevelObjects key of the placed level object hit (one instance’s key on an instanced mesh), the same on every client; null for an entity, anything spawned at runtime, and characters.
location
Section titled “location”
readonlylocation:Vec3
Defined in: client/api.d.ts:6404
Where the trace stopped. For a line trace this is the impact point.
normal
Section titled “normal”
readonlynormal:Vec3
Defined in: client/api.d.ts:6414
Normal of the trace shape at the hit; for a line trace, the same as impactNormal.
objectType
Section titled “objectType”
readonlyobjectType:string|null
Defined in: client/api.d.ts:6439
The hit body’s object type (“worldStatic”, “pawn”, “shallowWater”, …), null when the hit has no component.
startPenetrating
Section titled “startPenetrating”
readonlystartPenetrating:boolean
Defined in: client/api.d.ts:6434
Whether start was already inside the body hit; the normals are then unreliable.
surface
Section titled “surface”
readonlysurface:string|null
Defined in: client/api.d.ts:6444
The physical surface hit, as the game names it (“Grass”, “Stone”, “Water”, “Default”, …); null without a physical material.
readonlytime:number
Defined in: client/api.d.ts:6429
Fraction of the way from start to end, 0..1.