DeepAR 3.0 introduces physics components that allow you to build simple physics simulations. This functionality is still in beta and some bugs might be present. We recommend you save your effects frequently.

The new physics components, as well as debug options, can be found in the Physics menu item of the menu bar.

Physics World

Controls the child and descendant physics objects. This component must be added to an ancestor node in order for the simulation to run.

Parameters:

  • Enable Simulation

    • enable/disable physics simulation

    • setting this value to false will behave the same as if no physics world was added

  • Gravity

    • the force representing gravity in world space (positive Y is down)

  • Kinematic Knockback Factor

    • multiplier of an impulse which will be applied by static physics bodies to non-static physics bodies with which they collide

    • setting this value to 0 will disable the knockback.

NOTE: Physics objects that are assigned to different physics worlds will NOT interact with each other.

Physics Body

Adding any Physics body component to a game object will put its motion under the control of the ancestor Physics world.

Physics body components differ in the shape of their colliders.

The default colliders have fixed rotation values - if added to the object itself, they inherit the position, but not the other properties.

Physics Box Body

A physics body with a box collider.

Parameters

  • Static object

    • static objects are not controlled by physics but do interact with other physics body objects

    • static objects implicitly have zero mass

  • Mass

    • the mass of an object

    • zero mass implies static object

  • Ignore gravity

    • controls if the object is affected by gravity

    • other forces will still move the object

  • Solid object

    • solid objects will collide with other solid objects

    • making bodies non-solid can be useful for detecting collisions, but not responding to them

  • Fixed Position

    • physics does not affect the position of the object in the axes that are fixed

  • Fixed Rotation

    • physics does not affect the rotation of the object in the axes that are fixed

  • Restitution

    • coefficient representing the elastic collision ratio for a certain object

  • Extent

    • X, Y, and Z sizes of the collider

Physics Sphere Body

A physics body with a sphere collider.

Parameters

  • Static Object, Mass, Ignore Gravity, Solid Object, Fixed Position, Fixed Rotation, Restitution

    • same as the Physics Box Body

  • Radius

    • radius of the sphere

Physics Capsule Body

A physics body with a capsule collider.

Parameters

  • Static Object, Mass, Ignore Gravity, Solid Object, Fixed Position, Fixed Rotation, Restitution

    • same as the Physics Box Body

  • Radius

    • radius of the capsule

  • Height

    • the height of the cylinder between two half spheres

    • height of 0 makes this the same as a sphere collider

Constraints

Logical building block components which will allow you to create a constraint link between the current game object and the parent game object, both of which must have a physics body component.

Physics Spring Constraint

Spring constraint between the two linked physics bodies.

Parameters

  • Inherit From Parent

    • when a parent body also has a physics constraint of the same type as its parent, you can check this option to inherit the same parameters (making the setup a lot easier for chains where each element has the same properties)

  • Local Contact Pivot

    • offset of the constraint contact point from the current object (in current object local space)

  • Parent Contact Pivot

    • offset of the constraint contact point from the parent object (in parent object local space)

  • ERP

    • Error reduction parameter

  • CFM

    • Constraint force mixing

  • No Elongation Limit

    • disables minimum and maximum elongation limit of the spring (the spring can be infinitely compressed and expanded)

  • Minimum Elongation

    • length of the spring when maximally compressed

  • Maximum Elongation

    • length of the spring when maximally expanded

  • Stationary Elongation

    • length of the spring when in equilibrium

    • the spring will oscillate around this point

  • Stationary Direction

    • the direction in which the spring expands

  • Is In World Space

    • if checked, the Stationary Direction is in world space, otherwise, it is in the parent body’s local space

  • Enable Spring

    • enables/disables the spring

  • ˜Spring Stiffness

    • force required to compress or expand the spring

  • Spring Damping

    • influence of oscillation around the stationary (equilibrium) point

Physics Rope Constraint

Rope constraint between the two linked physics bodies.

Parameters

  • Inherit From Parent, Local Contact Pivot, Parent Contact Pivot, Override ERP, Override CFM

    • same as the Physics Spring Constraint

  • Rope Length

    • length of the rope

Modifiers

Physics Force Modifier

Allows a constant directional force to be added to a Physics body.

Parameters

  • Enable Modifier

    • enable/disable physics modifier.

    • setting this value to false will behave the same as if no physics force modifier was added

  • Apply To Children

    • apply force to child game objects (shallow)

  • Apply To Descendants

    • apply force to child game objects (recursive)

  • Force

    • force vector

  • Is In World Space

    • if true the force vector is in world space, otherwise it is in the game objects local space

  • Scale by mass

    • scales the force by the mass of the physics body (so the specified force will behave as if it was acceleration instead)

Debug

Options for debugging and setting up physics.

Simulate physics

If disabled physics will not be simulated, useful for setting up a scene, especially if there are multiple physics world components in the scene.

Show Colliders

Shows the wireframe colliders of physics body objects as well as the pivot points of the constraint objects.

Did this answer your question?