Connection#
A joint from the body this object sits under to another placed object (ConnectTo) or, when that is empty, the world. Place it as an empty under the body: its position is the anchor and its local X axis the hinge axis (Y is the hinge's reference normal). Kinds: Hinge (one axis), Point (a ring: swings any way), Fixed (welded), Distance (a rope/rod: keeps the anchors within MaxDistance, 0 = their starting distance). It breaks when its load passes BreakForce newtons, or when Matter damage at its anchor passes BreakDamage (0 turns either off). When the object fractures, the joint follows the piece — or the intact cluster — that contains its anchor.
public sealed class Connection : ScriptMembers: Break · BreakDamage · BreakForce · Broken · BrokenBy · ConnectTo · IsBroken · Kind · Load · MaxAngle · MaxDistance · MinAngle
Break#
public void Break();BreakDamage#
[DefaultValue(.25f)]
public float BreakDamage;Matter damage at the anchor that breaks it (1 ≈ heavily damaged); 0 = never by damage.
BreakForce#
[DefaultValue(0f)]
public float BreakForce;Newtons of load that break it; 0 = never by load.
Broken#
public event Action<Connection>? Broken;BrokenBy#
public string? BrokenBy { get; }What broke it ("load", "damage" or "script"), once broken.
ConnectTo#
public SceneReference ConnectTo;The other object (its body, or the body it sits under); empty = the world.
IsBroken#
public bool IsBroken { get; }Kind#
[DefaultValue(JointKind.Hinge)]
public JointKind Kind;Load#
public float Load { get; }The joint's load over the last step, in newtons.
MaxAngle#
[DefaultValue(180f)]
public float MaxAngle;MaxDistance#
[DefaultValue(0f)]
public float MaxDistance;Distance joints: the longest the anchors may be apart (m); 0 = their starting distance.
MinAngle#
[DefaultValue(-180f)]
public float MinAngle;Related types#
JointKind · SceneReference · Script
Source#
- Connection.cs