var angularDamp: DoubleDamps the body’s rotation. By default, the body will use the Default Angular Damp in Project > Project Settings > Physics > 2d or any value override set by an Area2D the body is in. Depending on angularDampMode, you can set angularDamp to be added to or to replace the body’s damping value.
var angularDampMode: RigidBody2D.DampModeDefines how angularDamp is applied. See DampMode for possible values.
var angularVelocity: DoubleThe body’s rotational velocity in radians per second.
var bodyEntered: Signal3Emitted when a collision with another PhysicsBody2D or TileMap occurs. Requires contactMonitor to be set to true and maxContactsReported to be set high enough to detect all the collisions. TileMaps are detected if the TileSet has Collision Shape2Ds.
var bodyExited: Signal4Emitted when the collision with another PhysicsBody2D or TileMap ends. Requires contactMonitor to be set to true and maxContactsReported to be set high enough to detect all the collisions. TileMaps are detected if the TileSet has Collision Shape2Ds.
var bodyShapeEntered: Signal1Emitted when one of this RigidBody2D’s Shape2Ds collides with another PhysicsBody2D or TileMap’s Shape2Ds. Requires contactMonitor to be set to true and maxContactsReported to be set high enough to detect all the collisions. TileMaps are detected if the TileSet has Collision Shape2Ds.
var bodyShapeExited: Signal2Emitted when the collision between one of this RigidBody2D’s Shape2Ds and another PhysicsBody2D or TileMap’s Shape2Ds ends. Requires contactMonitor to be set to true and maxContactsReported to be set high enough to detect all the collisions. TileMaps are detected if the TileSet has Collision Shape2Ds.
var canSleep: BoolIf true, the body can enter sleep mode when there is no movement. See sleeping.
var centerOfMass: Vector2The body’s custom center of mass, relative to the body’s origin position, when centerOfMassMode is set to .custom. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration.
var centerOfMassMode: RigidBody2D.CenterOfMassModeDefines the way the body’s center of mass is set. See CenterOfMassMode for possible values.
var constantForce: Vector2The body’s total constant positional forces applied during each physics update.
var constantTorque: DoubleThe body’s total constant rotational forces applied during each physics update.
var contactMonitor: BoolIf true, the RigidBody2D will emit signals when it collides with another body.
var continuousCd: RigidBody2D.CCDModeContinuous collision detection mode.
var customIntegrator: BoolIf true, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the _integrateForces(state:) method, if that virtual method is overridden.
var freeze: BoolIf true, the body is frozen. Gravity and forces are not applied anymore.
var freezeMode: RigidBody2D.FreezeModeThe body’s freeze mode. Can be used to set the body’s behavior when freeze is enabled. See FreezeMode for possible values.
var gravityScale: DoubleMultiplies the gravity applied to the body. The body’s gravity is calculated from the Default Gravity value in Project > Project Settings > Physics > 2d and/or any additional gravity vector applied by Area2Ds.
var inertia: DoubleThe body’s moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value.
var linearDamp: DoubleDamps the body’s movement. By default, the body will use the Default Linear Damp in Project > Project Settings > Physics > 2d or any value override set by an Area2D the body is in. Depending on linearDampMode, you can set linearDamp to be added to or to replace the body’s damping value.
var linearDampMode: RigidBody2D.DampModeDefines how linearDamp is applied. See DampMode for possible values.
var linearVelocity: Vector2The body’s linear velocity in pixels per second. Can be used sporadically, but don’t set this every frame, because physics may run in another thread and runs at a different granularity. Use _integrateForces(state:) as your process loop for precise control of the body state.
var lockRotation: BoolIf true, the body cannot rotate. Gravity and forces only apply linear movement.
var mass: DoubleThe body’s mass.
var maxContactsReported: Int32The maximum number of contacts that will be recorded. Requires a value greater than 0 and contactMonitor to be set to true to start to register contacts. Use getContactCount to retrieve the count or getCollidingBodies to retrieve bodies that have been collided with.
var physicsMaterialOverride: PhysicsMaterial?The physics material override for the body.
var sleeping: BoolIf true, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the applyImpulse(_:position:) or applyForce(_:position:) methods.
var sleepingStateChanged: SimpleSignalEmitted when the physics engine changes the body’s sleeping state.
func addConstantCentralForce(Vector2)Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with constant_force = Vector2(0, 0).
func addConstantForce(Vector2, position: Vector2)Adds a constant positioned force to the body that keeps being applied over time until cleared with constant_force = Vector2(0, 0).
func addConstantTorque(Double)Adds a constant rotational force without affecting position that keeps being applied over time until cleared with constant_torque = 0.
func applyCentralForce(Vector2)Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update.
func applyCentralImpulse(Vector2)Applies a directional impulse without affecting rotation.
func applyForce(Vector2, position: Vector2)Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
func applyImpulse(Vector2, position: Vector2)Applies a positioned impulse to the body.
func applyTorque(Double)Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update.
func applyTorqueImpulse(torque: Double)Applies a rotational impulse to the body without affecting the position.
func getCollidingBodies() -> ObjectCollection<Node2D>Returns a list of the bodies colliding with this one. Requires contactMonitor to be set to true and maxContactsReported to be set high enough to detect all the collisions.
func getContactCount() -> Int32Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see contactMonitor).
func setAxisVelocity(Vector2)Sets the body’s velocity on the given axis. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.