Api Sandbox PhysicsTraceResult
struct

PhysicsTraceResult

public sealed struct PhysicsTraceResult

Properties

Name Type Description
Bone Int32 The id of the hit bone (either from hitbox or physics shape)
Distance Single The distance between start and end positions.

Fields

Name Type Description
Hit Boolean Whether the trace hit something or not
StartedSolid Boolean Whether the trace started in a solid
StartPosition Vector3 The start position of the trace
EndPosition Vector3 The end or hit position of the trace
HitPosition Vector3 The hit position of the trace
Normal Vector3 The hit surface normal (direction vector)
Fraction Single A fraction [0..1] of where the trace hit between the start and the original end positions
Body PhysicsBody The physics object that was hit, if any
Shape PhysicsShape The physics shape that was hit, if any
Surface Surface The physical properties of the hit surface
Direction Vector3 The direction of the trace ray
Triangle Int32 The triangle index hit, if we hit a mesh physics shape
Tags String[] The tags that the hit shape had
Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.PhysicsTraceResult