Scripting API
Scripting API
Rigidbody2D
Struct in Abyss.Physics2D, from Abyss.Physics2D.
A body Physics 2D moves: by gravity, by what it meets and by what code does to it, its colliders — a BoxCollider2D and the others on the same entity, and those on the entities under it that have no Rigidbody 2D nearer — what it meets with. Its place is the entity's Transform, across X and Y, turned about Z; its velocities are what the last step left, and setting them is what code moves it by.
public struct Rigidbody2DRemarks
Forces, impulses and a move to a place are asked of Physics2D, which applies them at the next step. An entity with colliders and no body at or above it is ground: it does not move. A child with a Rigidbody 2D of its own is a body of its own.
Fields
Type
public BodyType2D TypeHow it moves.
UseAutoMass
public bool UseAutoMassWhether its mass is worked out from its colliders, each its size times its Density, rather than Rigidbody2D.Mass, which the step then says it was.
Mass
public float MassIts mass, in kilograms, whatever its colliders' sizes; what they make it where it uses auto mass.
GravityScale
public float GravityScaleHow much of gravity pulls it: 1 all, 0 none, -1 upwards.
LinearDamping
public float LinearDampingHow quickly its moving slows of itself, as in air.
AngularDamping
public float AngularDampingHow quickly its turning slows of itself.
FreezeRotation
public bool FreezeRotationWhether it never turns, as a character standing up does not.
Interpolate
public Interpolation2D InterpolateWhether it is drawn between fixed steps.
CollisionDetection
public CollisionDetection2D CollisionDetectionHow it is kept from passing through what it meets.
LinearVelocity
public Vector2 LinearVelocityHow fast it moves, in meters a second: what the last step left, and what code sets to move it.
AngularVelocity
public float AngularVelocityHow fast it turns, in degrees a second, anticlockwise.
