Physics Engine 2.0 Reference
The physics engine simulates realistic object physics, with gravity, forces, joints, etc. It's perfect for games that need to have realistic behaving objects and a gameplay centered around it. Read more explanations about it.
Actions
World time scale
Modify the world time scale. While an object is needed, this will apply to all objects using the behavior.
Conditions
Collision
Check if two objects collide.
Collision started
Check if two objects just started colliding during this frame.
Collision stopped
Check if two objects just stopped colliding at this frame.
Physics Engine 2.0
Simulate realistic object physics with gravity, forces, joints, etc.
Behavior actions
Add distance joint
Add a distance joint between two objects. The length is converted to meters using the world scale on X. The frequency and damping ratio are related to the joint speed of oscillation and how fast it stops.
Add friction joint
Add a friction joint between two objects.
Add gear joint
Add a gear joint between two joints. Attention: Gear joints require the joints to be revolute or prismatic, and both of them to be attached to a static body as first object.
Add motor joint
Add a motor joint between two objects. The position and angle offsets are relative to the first object.
Add mouse joint
Add a mouse joint to an object (makes the object move towards a specific point).
Add prismatic joint
Add a prismatic joint between two objects. The translation limits are converted to meters using the world scale on X.
Add pulley joint
Add a pulley joint between two objects. Lengths are converted to meters using the world scale on X.
Add revolute joint
Add a revolute joint to an object at a fixed point. The object is attached as the second object in the joint, so you can use this for gear joints.
Add revolute joint between two bodies
Add a revolute joint between two objects. The reference angle determines what is considered as the base angle at the initial state.
Add rope joint
Add a rope joint between two objects. The maximum length is converted to meters using the world scale on X.
Add weld joint
Add a weld joint between two objects.
Add wheel joint
Add a wheel joint between two objects. Higher frequencies means higher suspensions. Damping determines oscillations, critical damping of 1 means no oscillations.
Angular damping
Modify an object angular damping. How much angular speed is lost across the time.
Angular velocity
Modify an object angular velocity.
Apply angular impulse (rotational impulse)
Apply an angular impulse (also called a "rotational impulse") to the object. It instantly changes the rotation speed, to give an initial speed for instance.
Apply force
Apply a force to the object over time. It "accelerates" an object and must be used every frame during a time period.
Apply force toward position
Apply a force to the object over time to move it toward a position. It "accelerates" an object and must be used every frame during a time period.
Apply impulse
Apply an impulse to the object. It instantly changes the speed, to give an initial speed for instance.
Apply impulse toward position
Apply an impulse to the object to move it toward a position. It instantly changes the speed, to give an initial speed for instance.
Apply force (angle)
Apply a force to the object over time using polar coordinates. It "accelerates" an object and must be used every frame during a time period.
Apply impulse (angle)
Apply an impulse to the object using polar coordinates. It instantly changes the speed, to give an initial speed for instance.
Apply torque (rotational force)
Apply a torque (also called "rotational force") to the object. It "accelerates" an object rotation and must be used every frame during a time period.
Density
Modify an object density. The body's density and volume determine its mass.
Distance joint damping ratio
Modify a distance joint damping ratio.
Distance joint frequency
Modify a distance joint frequency.
Distance joint length
Modify a distance joint length.
Enable layer
Enable or disable a layer for an object. Two objects collide if any layer of the first object matches any mask of the second one and vice versa.
Enable mask
Enable or disable a mask for an object. Two objects collide if any layer of the first object matches any mask of the second one and vice versa.
Enable prismatic joint limits
Enable or disable a prismatic joint limits.
Enable prismatic joint motor
Enable or disable a prismatic joint motor.
Enable revolute joint limits
Enable or disable a revolute joint angle limits.
Enable revolute joint motor
Enable or disable a revolute joint motor.
Enable wheel joint motor
Enable or disable a wheel joint motor.
Friction
Modify an object friction. How much energy is lost from the movement of one object over another. The combined friction from two bodies is calculated as 'sqrt(bodyA.friction * bodyB.friction)'.
Friction joint max force
Modify a friction joint maximum force.
Friction joint max torque
Modify a friction joint maximum torque.
Gear joint ratio
Modify a Gear joint ratio.
World gravity
Modify the world gravity. While an object is needed, this will apply to all objects using the behavior.
Gravity scale
Modify an object gravity scale. The gravity applied to an object is the world gravity multiplied by the object gravity scale.
Linear damping
Modify an object linear damping. How much movement speed is lost across the time.
Linear velocity towards an angle
Set the linear velocity towards an angle.
Linear velocity X
Modify an object linear velocity on X.
Linear velocity Y
Modify an object linear velocity on Y.
Motor joint angular offset
Modify a motor joint angular offset.
Motor joint correction factor
Modify a motor joint correction factor.
Motor joint max force
Modify a motor joint maximum force.
Motor joint max torque
Modify a motor joint maximum torque.
Motor joint offset
Modify a motor joint offset.
Mouse joint damping ratio
Set a mouse joint damping ratio.
Mouse joint frequency
Set a mouse joint frequency.
Mouse joint max force
Set a mouse joint maximum force.
Mouse joint target
Set a mouse joint target.
Prismatic joint limits
Modify a prismatic joint limits.
Prismatic joint max motor force
Modify a prismatic joint maximum motor force.
Prismatic joint motor speed
Modify a prismatic joint motor speed.
Remove joint
Remove a joint from the scene.
Restitution
Modify an object restitution. Energy conservation on collision. The combined restitution from two bodies is calculated as 'max(bodyA.restitution, bodyB.restitution)'.
Revolute joint limits
Modify a revolute joint angle limits.
Revolute joint max motor torque
Modify a revolute joint maximum motor torque.
Revolute joint motor speed
Modify a revolute joint motor speed.
Rope joint max length
Modify a rope joint maximum length.
Treat as bullet
Treat the object as a bullet. Better collision handling on high speeds at cost of some performance.
Set as dynamic
Set an object as dynamic. Is affected by gravity, forces and velocities.
Fixed rotation
Enable or disable an object fixed rotation. If enabled the object won't be able to rotate.
Set as kinematic
Set an object as kinematic. Is like a static body but can be moved through its velocity.
Sleeping allowed
Allow or not an object to sleep. If enabled the object will be able to sleep, improving performance for non-currently-moving objects.
Set as static
Set an object as static. Is not affected by gravity, and can't be moved by forces or velocities at all.
Shape scale
Modify an object shape scale. It affects custom shape dimensions and shape offset, if custom dimensions are not set the body will be scaled automatically to the object size.
Weld joint damping ratio
Modify a weld joint damping ratio.
Weld joint frequency
Modify a weld joint frequency.
Wheel joint damping ratio
Modify a wheel joint damping ratio.
Wheel joint frequency
Modify a wheel joint frequency.
Wheel joint max motor torque
Modify a wheel joint maximum motor torque.
Wheel joint motor speed
Modify a wheel joint motor speed.
Behavior conditions
Angular damping
Test an object angular damping.
Angular velocity
Test an object angular velocity.
Density
Test an object density.
Friction
Test an object friction.
Gravity scale
Test an object gravity scale.
World gravity on X axis
Compare the world gravity on X axis.
World gravity on Y axis
Compare the world gravity on Y axis.
Has fixed rotation
Check if an object has fixed rotation.
Is treated as a bullet
Check if the object is being treated as a bullet.
Is dynamic
Check if an object is dynamic.
Is kinematic
Check if an object is kinematic.
Is sleeping
Check if an object is sleeping.
Is sleeping allowed
Check if an object can sleep.
Is static
Check if an object is static.
Joint first object
Check if an object is the first object on a joint.
Joint reaction force
Test a joint reaction force.
Joint reaction torque
Test a joint reaction torque.
Joint second object
Check if an object is the second object on a joint.
Layer enabled
Check if an object has a specific layer enabled.
Linear damping
Test an object linear damping.
Linear velocity
Test an object linear velocity length.
Linear velocity X
Test an object linear velocity on X.
Linear velocity Y
Test an object linear velocity on Y.
Mask enabled
Check if an object has a specific mask enabled.
Linear velocity angle
Compare the linear velocity angle of the object.
Prismatic joint limits enabled
Check if a prismatic joint limits are enabled.
Prismatic joint motor enabled
Check if a prismatic joint motor is enabled.
Restitution
Test an object restitution.
Revolute joint limits enabled
Check if a revolute joint limits are enabled.
Revolute joint motor enabled
Check if a revolute joint motor is enabled.
World time scale
Compare the world time scale.
Wheel joint motor enabled
Check if a wheel joint motor is enabled.
Behavior expressions
Expression | Description | |
---|---|---|
Object.Physics2::AngularDamping() |
Get the angular damping of an object. | |
Object.Physics2::AngularVelocity() |
Get the angular velocity of an object. | |
Object.Physics2::Density() |
Get the density of an object. | |
Object.Physics2::DistanceJointDampingRatio() |
Distance joint damping ratio | |
Object.Physics2::DistanceJointFrequency() |
Distance joint frequency | |
Object.Physics2::DistanceJointLength() |
Distance joint length | |
Object.Physics2::Friction() |
Get the friction of an object. | |
Object.Physics2::FrictionJointMaxForce() |
Friction joint maximum force | |
Object.Physics2::FrictionJointMaxTorque() |
Friction joint maximum torque | |
Object.Physics2::GearJointFirstJoint() |
Gear joint first joint | |
Object.Physics2::GearJointRatio() |
Gear joint ratio | |
Object.Physics2::GearJointSecondJoint() |
Gear joint second joint | |
Object.Physics2::GravityScale() |
Get the gravity scale of an object. | |
Object.Physics2::GravityX() |
World gravity on X axis | |
Object.Physics2::GravityY() |
World gravity on Y axis | |
Object.Physics2::Inertia() |
Return the rotational inertia of the object (in kilograms · meters²) | |
Object.Physics2::JointFirstAnchorX() |
Joint first anchor X | |
Object.Physics2::JointFirstAnchorY() |
Joint first anchor Y | |
Object.Physics2::JointReactionForce() |
Joint reaction force | |
Object.Physics2::JointReactionTorque() |
Joint reaction torque | |
Object.Physics2::JointSecondAnchorX() |
Joint second anchor X | |
Object.Physics2::JointSecondAnchorY() |
Joint second anchor Y | |
Object.Physics2::LinearDamping() |
Get the linear damping of an object. | |
Object.Physics2::LinearVelocity() |
Get the linear velocity of an object. | |
Object.Physics2::LinearVelocityAngle() |
Get the linear velocity angle of an object. | |
Object.Physics2::LinearVelocityX() |
Get the linear velocity of an object on X axis. | |
Object.Physics2::LinearVelocityY() |
Get the linear velocity of an object on Y axis. | |
Object.Physics2::Mass() |
Return the mass of the object (in kilograms) | |
Object.Physics2::MassCenterX() |
Mass center X | |
Object.Physics2::MassCenterY() |
Mass center Y | |
Object.Physics2::MotorJointAngularOffset() |
Motor joint angular offset | |
Object.Physics2::MotorJointCorrectionFactor() |
Motor joint correction factor | |
Object.Physics2::MotorJointMaxForce() |
Motor joint maximum force | |
Object.Physics2::MotorJointMaxTorque() |
Motor joint maximum torque | |
Object.Physics2::MotorJointOffsetX() |
Motor joint offset X | |
Object.Physics2::MotorJointOffsetY() |
Motor joint offset Y | |
Object.Physics2::MouseJointDampingRatio() |
Mouse joint damping ratio | |
Object.Physics2::MouseJointFrequency() |
Mouse joint frequency | |
Object.Physics2::MouseJointMaxForce() |
Mouse joint maximum force | |
Object.Physics2::MouseJointTargetX() |
Mouse joint target X | |
Object.Physics2::MouseJointTargetY() |
Mouse joint target Y | |
Object.Physics2::PrismaticJointAxisAngle() |
Prismatic joint axis angle | |
Object.Physics2::PrismaticJointMaxMotorForce() |
Prismatic joint maximum motor force | |
Object.Physics2::PrismaticJointMaxTranslation() |
Prismatic joint maximum translation | |
Object.Physics2::PrismaticJointMinTranslation() |
Prismatic joint minimum translation | |
Object.Physics2::PrismaticJointMotorForce() |
Prismatic joint motor force | |
Object.Physics2::PrismaticJointMotorSpeed() |
Prismatic joint motor speed | |
Object.Physics2::PrismaticJointReferenceAngle() |
Prismatic joint reference angle | |
Object.Physics2::PrismaticJointSpeed() |
Prismatic joint speed | |
Object.Physics2::PrismaticJointTranslation() |
Prismatic joint current translation | |
Object.Physics2::PulleyJointFirstGroundAnchorX() |
Pulley joint first ground anchor X | |
Object.Physics2::PulleyJointFirstGroundAnchorY() |
Pulley joint first ground anchor Y | |
Object.Physics2::PulleyJointFirstLength() |
Pulley joint first length | |
Object.Physics2::PulleyJointRatio() |
Pulley joint ratio | |
Object.Physics2::PulleyJointSecondGroundAnchorX() |
Pulley joint second ground anchor X | |
Object.Physics2::PulleyJointSecondGroundAnchorY() |
Pulley joint second ground anchor Y | |
Object.Physics2::PulleyJointSecondLength() |
Pulley joint second length | |
Object.Physics2::Restitution() |
Get the restitution of an object. | |
Object.Physics2::RevoluteJointAngle() |
Revolute joint current angle | |
Object.Physics2::RevoluteJointMaxAngle() |
Revolute joint maximum angle | |
Object.Physics2::RevoluteJointMaxMotorTorque() |
Revolute joint maximum motor torque | |
Object.Physics2::RevoluteJointMinAngle() |
Revolute joint minimum angle | |
Object.Physics2::RevoluteJointMotorSpeed() |
Revolute joint motor speed | |
Object.Physics2::RevoluteJointMotorTorque() |
Revolute joint motor torque | |
Object.Physics2::RevoluteJointReferenceAngle() |
Revolute joint reference angle | |
Object.Physics2::RevoluteJointSpeed() |
Revolute joint angular speed | |
Object.Physics2::RopeJointMaxLength() |
Rope joint maximum length | |
Object.Physics2::TimeScale() |
World time scale | |
Object.Physics2::WeldJointDampingRatio() |
Weld joint damping ratio | |
Object.Physics2::WeldJointFrequency() |
Weld joint frequency | |
Object.Physics2::WeldJointReferenceAngle() |
Weld joint reference angle | |
Object.Physics2::WheelJointAxisAngle() |
Wheel joint axis angle | |
Object.Physics2::WheelJointDampingRatio() |
Wheel joint damping ratio | |
Object.Physics2::WheelJointFrequency() |
Wheel joint frequency | |
Object.Physics2::WheelJointMaxMotorTorque() |
Wheel joint maximum motor torque | |
Object.Physics2::WheelJointMotorSpeed() |
Wheel joint motor speed | |
Object.Physics2::WheelJointMotorTorque() |
Wheel joint motor torque | |
Object.Physics2::WheelJointSpeed() |
Wheel joint speed | |
Object.Physics2::WheelJointTranslation() |
Wheel joint current translation | |
Object.Physics2::WorldScale() |
Return the world scale. |
This page is an auto-generated reference page about the Physics Engine 2.0 feature of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop features here.