Addon ID

  • justifun_box3dbody

Info

Statistics

  • Download count9 total downloads
  • Latest download count 9 downloads of latest version
  • Average download count4 downloads per day average

Owners

A list of all Actions, Conditions and Expressions supported in this addon.

  • Actions

    Set {my} enabled {0}

    Enable or disable syncing.

    Recreate {my} physics body

    Destroy and recreate the Box3D body from current properties and object size.

    Set {my} collision shape to {0}, recreate {1}

    Set the collider shape used when the Box3D body is recreated.

    Set {my} shape radius to {0}, recreate {1}

    Set the radius used by rounded/generated shapes.

    Set {my} generated hull sides to {0}, recreate {1}

    Set the side count for cylinder and cone hull shapes.

    Set {my} cone top radius to {0}, recreate {1}

    Set the top radius for cone/frustum shapes.

    Set {my} friction to {0}

    Set the stored friction value and update the live Box3D shape.

    Set {my} restitution to {0}

    Set the stored restitution value and update the live Box3D shape.

    Set {my} collision filter group to {0}

    Set the Box3D collision filter category and mask bits for this body.

    Set {my} surface tangent velocity to ({0}, {1}, {2})

    Set the Construct-space surface tangent velocity for conveyor-belt style contacts.

    Set {my} linear dampening to {0}

    Set the stored linear dampening value and update the live Box3D body.

    Set {my} angular dampening to {0}

    Set the stored angular dampening value and update the live Box3D body.

    Set {my} rolling resistance to {0}

    Set the stored rolling resistance value and update the live Box3D body.

    Set {my} gravity factor to {0}

    Set the stored gravity factor and update the live Box3D body.

    Set {my} bullet mode to {0}

    Enable bullet continuous collision mode for this body.

    Set {my} continuous collision detection to {0}

    Enable or disable per-body continuous collision detection for fast-moving bodies.

    Set {my} motion locks: position X {0}, Y {1}, Z {2}, rotation X {3}, Y {4}, Z {5}

    Lock selected physics translation and rotation axes while keeping the body Dynamic.

    Sync {my} object transform to physics

    Copy this object's transform to the Box3D body.

    Sync {my} object transform from physics

    Copy the Box3D body transform to this object.

    Wake {my} body include touching objects {0}

    Wake this Box3D body.

    Rotate {my} toward position ({0}, {1}, {2}), up {3}, lock vertical {4}, strength {5}, damping {6}, max torque {7}

    Apply torque that aims this object's local +Y axis at a Construct X/Y/Z position. Run every tick while it should turn.

    Rotate {my} toward rotation X {0} degrees, Y {1} degrees, Z {2} degrees, strength {3}, damping {4}, max torque {5}

    Apply torque that turns this body toward Construct X/Y/Z rotation values in degrees. Run every tick while it should turn.

    Move {my} physics body toward position ({0}, {1}, {2}), maximum force {3}

    Dynamic bodies are pulled toward the Construct X/Y/Z target by a critically damped, force-limited drive. Kinematic bodies still follow the target exactly and ignore maximum force.

    Set {my} linear velocity to ({0}, {1}, {2})

    Set body linear velocity in physics metres per second.

    Apply {my} impulse ({0}, {1}, {2}), wake {3}

    Apply a linear impulse at the body's center.

    Apply {my} impulse ({0}, {1}, {2}) at physics position ({3}, {4}, {5}), wake {6}

    Apply a linear impulse at a world-space physics position, generating rotation when off-center.

    Apply {my} angular impulse ({0}, {1}, {2}), wake {3}

    Apply an instant rotational impulse around the physics X/Y/Z axes.

    Apply {my} torque ({0}, {1}, {2}), wake {3}

    Apply torque around the physics X/Y/Z axes.

    Initialize Box3D

    Load the box3d.js WebAssembly module.

    Create world with default gravity

    Create a physics world using the behavior default gravity properties.

    Create world with gravity ({0}, {1}, {2})

    Create a physics world.

    Destroy world {0}

    Destroy a physics world and its bodies and shapes.

    Step world {0} by {1} seconds with {2} sub-steps

    Advance the physics simulation.

    Step world {0} by {1} seconds

    Advance the physics simulation using the default sub-step count.

    Cast ray on {my} from ({0},{1},{2}) to ({3},{4},{5})

    Cast a ray in physics space and test for a hit. Does not hit the casting body.

    Attach {my} shape from object {0}

    Attach the shape from the object with the given UID to this body. The other body is destroyed.

    Create explosion in world {0} at ({1}, {2}, {3}) radius {4} force {5}

    Apply an explosion impulse around a Construct-space position.

    Set world {0} gravity to ({1}, {2}, {3})

    Set world gravity.

    Set Box3D world {0} continuous collision to {1}

    Enable or disable continuous collision detection for a world.

    Set Box3D world {0} speculative contacts to {1}

    Enable or disable speculative contacts for a world.

    Set Box3D world {0} maximum linear speed to {1}

    Set the maximum linear speed used by the world.

  • Conditions

    {my} is enabled

    Test if the behavior is enabled.

    {my} has a physics body

    Test if the Box3D body has been created.

    Box3D is ready

    Test if the Box3D WASM module has finished initializing.

    World {0} exists

    Test if a world exists.

    On {my} enters sensor {0}

    Triggered on this object when it enters the selected sensor. This object is selected, so actions such as Destroy affect only it.

    On {my} exits sensor {0}

    Triggered on this object when it exits the selected sensor. This object is selected, so actions such as Destroy affect only it.

    Object {0} overlaps {my} sensor

    Test if the object with the given UID is currently inside this sensor.

    On {my} collision begins with {0}

    Triggered on this object when it begins colliding with the selected object. This object is selected, so actions affect only it.

    On {my} collision ends with {0}

    Triggered on this object when it stops colliding with the selected object. This object is selected, so actions affect only it.

    {my} collides with object {0}

    Test if this body is currently colliding with the given object UID.

    On {my} ray cast hit

    Triggered after a CastRay action hits an object.

  • Expressions

    WorldId

    Box3D world ID used by this behavior.

    BodyId

    Box3D body ID used by this behavior.

    ShapeId

    Box3D shape ID used by this behavior.

    LastWorldId

    Last created world ID.

    DefaultSubStepCount

    Default sub-step count.

    ShapeName

    Current collision shape name.

    ShapeRadius

    Current shape radius in Construct units.

    HullSides

    Current generated hull side count.

    ConeTopRadius

    Current cone top radius in Construct units.

    IsBullet

    1 if this body is using bullet mode, else 0.

    ContinuousCollision

    1 if this body has continuous collision detection enabled, else 0.

    Enabled

    1 if the behavior is enabled, else 0.

    ConfiguredWorldId

    Configured Box3D world ID property.

    BodyType

    Current body type name.

    CoordinateScale

    Construct units per physics metre.

    ZHeight

    Collider vertical height in Construct units.

    Density

    Current density property.

    Friction

    Current friction property.

    Restitution

    Current restitution property.

    CollisionFilterGroup

    Collision filter group/category bits this body belongs to.

    LinearDamping

    Current linear damping property.

    LinearDampening

    Current linear dampening property.

    AngularDamping

    Current angular damping property.

    AngularDampening

    Current angular dampening property.

    RollingResistance

    Current rolling resistance property.

    GravityScale

    Current gravity scale property.

    IsSensor

    1 if the body is configured as a sensor, else 0.

    DefaultGravityX

    Default world gravity X property.

    DefaultGravityY

    Default world gravity Y property.

    DefaultGravityZ

    Default world gravity Z property.

    SensorBodyId

    The body ID of the sensor involved in this object's most recent sensor enter or exit trigger.

    SensorBodyUID

    The UID of the sensor involved in this object's most recent sensor enter or exit trigger.

    SensorOverlapCount

    Number of objects currently inside this sensor.

    CollisionBodyUID

    The UID of the last object that began or ended colliding with this body.

    CollisionCount

    Number of objects currently colliding with this body.

    BodyDistanceTo

    Center-to-center distance (in physics metres) between this body and the object with the given UID. Returns -1 if either body does not exist.

    RayHitUID

    The UID of the object hit by the last CastRay action.

    RayHitShapeId

    The shape ID of the shape hit by the last CastRay action.

    RayHitX

    X coordinate of the hit point.

    RayHitY

    Y coordinate of the hit point.

    RayHitZ

    Z coordinate of the hit point.

    RayHitNormalX

    X component of the hit surface normal.

    RayHitNormalY

    Y component of the hit surface normal.

    RayHitNormalZ

    Z component of the hit surface normal.

    RayHitFraction

    Hit fraction along the ray (0 = start, 1 = end).

    MotionLockPositionX

    1 if physics X translation is locked, else 0.

    MotionLockPositionY

    1 if physics Y translation is locked, else 0.

    MotionLockPositionZ

    1 if physics Z translation is locked, else 0.

    MotionLockRotationX

    1 if physics X rotation is locked, else 0.

    MotionLockRotationY

    1 if physics Y rotation is locked, else 0.

    MotionLockRotationZ

    1 if physics Z rotation is locked, else 0.

    GravityFactor

    Current gravity factor property.

Box3D Character Controller

  • Actions

    Configure {my} character slope {0} step {1} jump height {2} gravity {3} max jumps {4} max fall speed {5} move speed {6} push strength {7}

    Configure the built-in capsule character controller. Distances and speeds use Construct units.

    Set {my} character push strength to {0}

    Set the force applied to Dynamic bodies the character moves into.

    Make {my} character jump

    Jump using the configured jump height and maximum jump count.

    Move {my} character direction ({0}, {1}, {2}) capsule radius {3} height {4}

    Move the configured character controller for one tick, applying move speed, gravity, slopes, and steps. Sensor shapes do not block movement.

    Configure {my} force character move force {0} max speed {1} jump impulse {2} friction {3} restitution {4} keep vertical {5}

    Configure the Dynamic-body controller that uses only Box3D forces and impulses. Values use Construct units.

    Move {my} force character direction X {0}, Y {1}

    Apply horizontal force toward the configured speed. Run every tick. Requires a Dynamic body and uses normal Box3D collisions.

    Make {my} force character jump

    Apply the configured upward impulse. This action does not perform a grounded check.

  • Expressions

    CharacterSlopeAngle

    Configured maximum walkable slope angle.

    CharacterStepHeight

    Configured maximum step height.

    CharacterJumpHeight

    Configured jump height.

    CharacterGravity

    Configured downward gravity.

    CharacterMaxJumps

    Configured maximum jump count.

    CharacterMaxFallSpeed

    Configured maximum fall speed.

    CharacterMoveSpeed

    Configured move speed.

    CharacterCurrentSpeed

    Actual movement speed in Construct units per second from the most recent Move Character action.

    CharacterPushStrength

    Configured force applied to Dynamic bodies the character moves into.

    IsCharacterGrounded

    Returns 1 when the character is on a walkable slope, otherwise 0.

    IsCharacterJumping

    Returns 1 while the character is rising after a jump, otherwise 0.

    IsCharacterFalling

    Returns 1 while the character is falling, otherwise 0.

    IsCharacterSliding

    Returns 1 when touching a slope steeper than the configured limit, otherwise 0.

Box3D Joints

  • Actions

    Create revolute joint {my} to {0} local anchor A ({1},{2},{3}) local anchor B ({4},{5},{6}) axis ({7},{8},{9}) collide {10} limit {11} {12}-{13} motor {14} speed {15} torque {16} spring {17} hertz {18} damping {19}

    Create a revolute (hinge) joint between this body and another body.

    Create spherical joint {my} to {0} local anchor A ({1},{2},{3}) local anchor B ({4},{5},{6}) collide {7} cone limit {8} cone angle {9} degrees spring {10} hertz {11} damping {12}

    Create a spherical (ball-and-socket) joint between this body and another body.

    Create distance joint {my} to {0} local anchor A ({1},{2},{3}) local anchor B ({4},{5},{6}) collide {7} lock rotation {8} length {9} spring {10} hertz {11} damping {12}

    Create a distance joint between this body and another body.

    Create weld joint {my} to {0} local anchor A ({1},{2},{3}) local anchor B ({4},{5},{6}) collide {7} keep initial rotation {8} spring {9} hertz {10} damping {11}

    Create a rigid weld joint between this body and another body.

    Create wheel joint {my} to {0} anchor A ({1}, {2}, {3}) anchor B ({4}, {5}, {6}) collide {7} suspension spring {8} hertz {9} damping {10}

    Create a wheel joint. Suspension moves along each joint frame local X axis and the wheel spins around local Z.

    Create prismatic joint {my} to {0} local anchor A ({1},{2},{3}) local anchor B ({4},{5},{6}) axis ({7},{8},{9}) collide {10} limit {11} {12}-{13} motor {14} speed {15} max force {16} spring {17} hertz {18} damping {19}

    Create a prismatic joint that allows sliding along one axis.

    Create parallel joint {my} to {0} collide {1} hertz {2} damping {3} max torque {4} constrain local axis {5}

    Create a parallel joint that keeps the bodies upright relative to each other.

  • Expressions

    RevoluteJointAngle

    Current angle of the revolute joint.

    RevoluteJointSpeed

    Current angular speed of the revolute joint.

    LastJointId

    ID of the last created joint.

    SphericalJointConeLimit

    Configured spherical-joint cone limit in degrees.

    SphericalJointConeAngle

    Current spherical-joint cone angle in degrees.