Class BreakablePartComponent
- Namespace
- LibreRally.Vehicle.Physics
- Assembly
- LibreRally.dll
Monitors the weld constraint each frame and breaks it when the measured constraint force exceeds BreakStrength.
Once broken, the part's BodyComponent becomes a free rigid body that interacts normally with the physics world.
Attach this to the same entity as the WeldConstraintComponent and the part's BodyComponent.
public class BreakablePartComponent : SyncScript, IIdentifiable, ICollectorHolder
- Inheritance
-
SyncScriptBreakablePartComponent
- Implements
-
IIdentifiableICollectorHolder
- Inherited Members
Properties
BreakStrength
Force threshold (N) above which the part detaches. Sourced from the minimum beamStrength of cross-boundary beams in the jbeam.
public float BreakStrength { get; set; }
Property Value
WeldConstraint
The weld constraint to break. Set by VehiclePhysicsBuilder.
public WeldConstraintComponent? WeldConstraint { get; set; }
Property Value
Methods
Update()
Monitors the weld constraint and detaches the part when the break threshold is exceeded.
public override void Update()