unreal.BodyInstance

class unreal.BodyInstance(sleep_family=SleepFamily.NORMAL, use_ccd=False, notify_rigid_body_collision=False, simulate_physics=False, enable_gravity=True, auto_weld=False, start_awake=True, generate_wake_events=False, max_depenetration_velocity=0.0, mass_in_kg_override=100.0, linear_damping=0.01, angular_damping=0.0, com_nudge=[0.0, 0.0, 0.0], mass_scale=1.0, inertia_tensor_scale=[1.0, 1.0, 1.0], walkable_slope_override=[WalkableSlopeBehavior.WALKABLE_SLOPE_DEFAULT, 0.0], phys_material_override=None, max_angular_velocity=3600.0, custom_sleep_threshold_multiplier=1.0, stabilization_threshold_multiplier=1.0, position_solver_iteration_count=8, velocity_solver_iteration_count=1)

Bases: unreal.StructBase

Container for a physics representation of an object

C++ Source:

  • Module: Engine
  • File: BodyInstance.h

Editor Properties: (see get_editor_property/set_editor_property)

  • angular_damping (float): [Read-Write] ‘Drag’ force added to reduce angular movement

  • auto_weld (bool): [Read-Write] If true and is attached to a parent, the two bodies will be joined into a single rigid body. Physical settings like collision profile and body settings are determined by the root

  • collision_enabled (CollisionEnabled): [Read-Write] Type of collision enabled.

    No Collision : Will not create any representation in the physics engine. Cannot be used for spatial queries (raycasts, sweeps, overlaps) or simulation (rigid body, constraints). Best performance possible (especially for moving objects) Query Only : Only used for spatial queries (raycasts, sweeps, and overlaps). Cannot be used for simulation (rigid body, constraints). Useful for character movement and things that do not need physical simulation. Performance gains by keeping data out of simulation tree. Physics Only : Only used only for physics simulation (rigid body, constraints). Cannot be used for spatial queries (raycasts, sweeps, overlaps). Useful for jiggly bits on characters that do not need per bone detection. Performance gains by keeping data out of query tree Collision Enabled : Can be used for both spatial queries (raycasts, sweeps, overlaps) and simulation (rigid body, constraints).

  • collision_profile_name (Name): [Read-Write] Collision Profile Name *

  • collision_responses (CollisionResponse): [Read-Write] Custom Channels for Responses

  • com_nudge (Vector): [Read-Write] User specified offset for the center of mass of this object, from the calculated location

  • custom_dof_plane_normal (Vector): [Read-Write] Locks physical movement along a custom plane for a given normal.

  • custom_sleep_threshold_multiplier (float): [Read-Write] If the SleepFamily is set to custom, multiply the natural sleep threshold by this amount. A higher number will cause the body to sleep sooner.

  • dof_mode (DOFMode): [Read-Write] Locks physical movement along specified axis.

  • enable_gravity (bool): [Read-Write] If object should have the force of gravity applied

  • generate_wake_events (bool): [Read-Write] Should ‘wake/sleep’ events fire when this object is woken up or put to sleep by the physics simulation.

  • inertia_tensor_scale (Vector): [Read-Write] Per-instance scaling of inertia (bigger number means it’ll be harder to rotate)

  • linear_damping (float): [Read-Write] ‘Drag’ force added to reduce linear movement

  • lock_rotation (bool): [Read-Write] When a Locked Axis Mode is selected, will lock rotation to the specified axis

  • lock_translation (bool): [Read-Write] When a Locked Axis Mode is selected, will lock translation on the specified axis

  • lock_x_rotation (bool): [Read-Write] Lock rotation about the X-axis

  • lock_x_translation (bool): [Read-Write] Lock translation along the X-axis

  • lock_y_rotation (bool): [Read-Write] Lock rotation about the Y-axis

  • lock_y_translation (bool): [Read-Write] Lock translation along the Y-axis

  • lock_z_rotation (bool): [Read-Write] Lock rotation about the Z-axis

  • lock_z_translation (bool): [Read-Write] Lock translation along the Z-axis

  • mass_in_kg_override (float): [Read-Write] Mass of the body in KG. By default we compute this based on physical material and mass scale. bOverrideMass to set this directly:

  • mass_scale (float): [Read-Write] Per-instance scaling of mass

  • max_angular_velocity (float): [Read-Write] The maximum angular velocity for this instance

  • max_depenetration_velocity (float): [Read-Write] The maximum velocity used to depenetrate this object

  • notify_rigid_body_collision (bool): [Read-Write] Should ‘Hit’ events fire when this object collides during physics simulation.

  • object_type (CollisionChannel): [Read-Write] Enum indicating what type of object this should be considered as when it moves

  • override_mass (bool): [Read-Write] If true, mass will not be automatically computed and you must set it directly

  • override_max_angular_velocity (bool): [Read-Write] Override the default max angular velocity

  • override_max_depenetration_velocity (bool): [Read-Write] Whether this body instance has its own custom MaxDepenetrationVelocity

  • override_walkable_slope_on_instance (bool): [Read-Write] Whether this instance of the object has its own custom walkable slope override setting.

  • phys_material_override (PhysicalMaterial): [Read-Write] Allows you to override the PhysicalMaterial to use for simple collision on this body.

  • position_solver_iteration_count (int32): [Read-Write] This physics body’s solver iteration count for position. Increasing this will be more CPU intensive, but better stabilized.

  • simulate_physics (bool): [Read-Write] If true, this body will use simulation. If false, will be ‘fixed’ (ie kinematic) and move where it is told. For a Skeletal Mesh Component, simulating requires a physics asset setup and assigned on the SkeletalMesh asset. For a Static Mesh Component, simulating requires simple collision to be setup on the StaticMesh asset.

  • sleep_family (SleepFamily): [Read-Write] The set of values used in considering when put this body to sleep.

  • stabilization_threshold_multiplier (float): [Read-Write] Stabilization factor for this body if Physics stabilization is enabled. A higher number will cause more aggressive stabilization at the risk of loss of momentum at low speeds. A value of 0 will disable stabilization for this body.

  • start_awake (bool): [Read-Write] If object should start awake, or if it should initially be sleeping

  • use_ccd (bool): [Read-Write] If true Continuous Collision Detection (CCD) will be used for this component

  • velocity_solver_iteration_count (int32): [Read-Write] This physics body’s solver iteration count for velocity. Increasing this will be more CPU intensive, but better stabilized.

  • walkable_slope_override (WalkableSlopeOverride): [Read-Write] Custom walkable slope override setting for this instance. GetWalkableSlopeOverride(), SetWalkableSlopeOverride():

angular_damping

(float) – [Read-Write] ‘Drag’ force added to reduce angular movement

auto_weld

(bool) – [Read-Write] If true and is attached to a parent, the two bodies will be joined into a single rigid body. Physical settings like collision profile and body settings are determined by the root

com_nudge

(Vector) – [Read-Write] User specified offset for the center of mass of this object, from the calculated location

custom_sleep_threshold_multiplier

(float) – [Read-Only] If the SleepFamily is set to custom, multiply the natural sleep threshold by this amount. A higher number will cause the body to sleep sooner.

enable_gravity

(bool) – [Read-Only] If object should have the force of gravity applied

generate_wake_events

(bool) – [Read-Only] Should ‘wake/sleep’ events fire when this object is woken up or put to sleep by the physics simulation.

inertia_tensor_scale

(Vector) – [Read-Write] Per-instance scaling of inertia (bigger number means it’ll be harder to rotate)

linear_damping

(float) – [Read-Write] ‘Drag’ force added to reduce linear movement

mass_in_kg

deprecated – ‘mass_in_kg’ was renamed to ‘mass_in_kg_override’.

mass_in_kg_override

(float) – [Read-Only] Mass of the body in KG. By default we compute this based on physical material and mass scale. bOverrideMass to set this directly:

mass_scale

(float) – [Read-Write] Per-instance scaling of mass

max_angular_velocity

(float) – [Read-Only] The maximum angular velocity for this instance

max_depenetration_velocity

(float) – [Read-Only] The maximum velocity used to depenetrate this object

notify_rigid_body_collision

(bool) – [Read-Only] Should ‘Hit’ events fire when this object collides during physics simulation.

phys_material_override

(PhysicalMaterial) – [Read-Only] Allows you to override the PhysicalMaterial to use for simple collision on this body.

position_solver_iteration_count

(int32) – [Read-Only] This physics body’s solver iteration count for position. Increasing this will be more CPU intensive, but better stabilized.

simulate_physics

(bool) – [Read-Write] If true, this body will use simulation. If false, will be ‘fixed’ (ie kinematic) and move where it is told. For a Skeletal Mesh Component, simulating requires a physics asset setup and assigned on the SkeletalMesh asset. For a Static Mesh Component, simulating requires simple collision to be setup on the StaticMesh asset.

sleep_family

(SleepFamily) – [Read-Write] The set of values used in considering when put this body to sleep.

stabilization_threshold_multiplier

(float) – [Read-Only] Stabilization factor for this body if Physics stabilization is enabled. A higher number will cause more aggressive stabilization at the risk of loss of momentum at low speeds. A value of 0 will disable stabilization for this body.

start_awake

(bool) – [Read-Only] If object should start awake, or if it should initially be sleeping

use_ccd

(bool) – [Read-Only] If true Continuous Collision Detection (CCD) will be used for this component

velocity_solver_iteration_count

(int32) – [Read-Only] This physics body’s solver iteration count for velocity. Increasing this will be more CPU intensive, but better stabilized.

walkable_slope_override

(WalkableSlopeOverride) – [Read-Only] Custom walkable slope override setting for this instance. GetWalkableSlopeOverride(), SetWalkableSlopeOverride():