Skip to content

Physics Influencer

Lets a world object or prop react to a Gravity Zone or Fluid Volume. It can also adjust the object’s center of mass for those interactions or for stability (for example, keeping a vessel upright). Changes to the active sections produce a wide variety of behaviors based on physical properties.

Every object using a Physics Influencer needs a Collider and a Rigidbody. The Rigidbody is added automatically if missing.

physics-influencer-default.png

Each section can be enabled or disabled via the tickbox on its header.

CCOM.png

Change Center of Mass lets you modify the center of mass with a new transform, which can be any GameObject that is a child of the affected GameObject.

Any child transform of the affected object. Repositions the center of mass of the GameObject, modifying its sitting stability, center of inertia, and (as a byproduct) center of buoyancy.

Continuously updates the center of mass to track the assigned transform.

bouyancy.png

Affects the physical behavior of the object in fluid. Density is an editor-only value that shows the expected density in g/m³. Volume is calculated as the sum of every collider on the object and its children in m³.

Recalculates the density and volume values in the inspector.

Coefficient of drag for the unsubmerged portion while travelling straight.

Coefficient of drag for the unsubmerged portion while turning.

Coefficient of drag for the submerged portion while travelling straight.

Coefficient of drag for the submerged portion while turning.

local-gravity.png

Forces the object instantly upright relative to the direction of gravity.

Multiplier for uprighting force based on current experienced gravity.

Applies a force to turn the object upright relative to gravity.

Speed at which the object returns to the aligned orientation.

Divided by the gentle align speed (with a floor of 0.1) to dampen the uprighting motion.

Local axis to constrain alignment torque to. Leave (0,0,0) to apply torque freely (all three axes).

When enabled, this object can act as (or be used by) a CVR Movement Parent. Read by the movement-parent system.

When enabled, the influencer skips applying forces while the object is being driven by a Movement Parent.

NameTypeDescription
DepthfloatFraction of reference points currently inside a fluid volume (0–1).
SubmergedboolTrue if at least one Fluid Volume is being touched.
AppliedGravityVector3The gravity vector currently being applied, after zone and factor adjustments.
AppliedGravityDirectionVector3Normalized AppliedGravity.
TimeSinceEnterfloatSeconds since the object first entered a fluid volume.
TimeSinceExitfloatSeconds since the object last exited all fluid volumes.

The Get* accessor methods (GetDepth, GetSubmerged, GetAppliedGravity, GetAppliedGravityDirection, GetTimeSinceEnter, GetTimeSinceExit) mirror the properties above.

At Start the influencer samples up to ~125 reference points across the combined bounds of every Collider on the object, snapped to the closest surface on each collider. Each FixedUpdate while submerged:

  1. Counts how many reference points are inside any touching fluid volume — this is Depth.
  2. Averages the submerged reference points to compute a center of lift.
  3. Lerps drag and angularDrag between the air and fluid values based on submerged fraction.
  4. If the submerged mass differs from the Rigidbody mass by more than 2.5%, adds gravity at the center of mass and buoyant lift at the center of lift; otherwise zeros the relevant axes of velocity so the object sits still.
  5. Adds the fluid’s stream force (scaled by submerged volume).

All force applications are gated on the internal applyForces flag, which the network-sync system can flip to hand off integration to a remote owner.

  • On Start, the component adds a CVR Shared Physics Controller (if not already present) and registers itself as an influence source.
  • Without a Gravity Zone, AppliedGravity is Vector3.down * GravitySystem.WorldObjectGravity scaled by gravityFactor (if Enable Local Gravity is on) or just Vector3.down * GravitySystem.WorldObjectGravity otherwise.

There are currently no examples. If you would like to add one, please contribute. Community contributions can be submitted to our Documentation GitHub.

  • CVR-GameFiles/ABI.CCK.Components/PhysicsInfluencer.cs