Quick answer: On the water collider: Is Trigger = false and Used By Effector = true. On floating bodies, ensure their colliders aren’t set as triggers.
A 2D platformer adds a water area with BuoyancyEffector2D. Player and crates fall through unchanged. The effector isn’t wired to the collider correctly.
Water Collider Settings
BuoyancyEffector2D + Collider2D on the same GameObject:
- Collider2D → Used By Effector = true.
- Collider2D → Is Trigger = false (BuoyancyEffector handles overlap detection internally).
Without Used By Effector, the collider is just a regular solid — not a buoyancy zone.
Tune Effector
Configure on BuoyancyEffector2D:
- Surface Level: Y position of water surface, in local coords.
- Density: water density. 1.0 = neutral; higher = floats stronger.
- Linear Drag / Angular Drag: damping in water.
- Flow Magnitude: lateral push for current effects.
Body Setup
Rigidbody2D + Collider2D on floating objects. Body must use Continuous or Discrete physics; mass-based behavior responds to density.
Light objects (mass=0.1) float quickly; heavy (mass=10) sink slowly. Sinking objects: mass > volume×density. Verify by tweaking.
Verifying
Drop crate. It hits water surface, slows, floats. Heavy crate sinks slowly. Apply force; lateral drag visible. Player can swim through with input.
“Effectors need both Used By Effector flag and a non-trigger collider. Effector handles overlap separately.”
For waves on the surface, animate Surface Level via a sine wave script — objects bob up and down realistically.