# ApplyWind

> Apply wind forces to this body's attached shapes. Forces are continuous (not impulses) and are computed per shape by Box2D using the drag/lift coefficients in input; this method is expected to be called every simulation step while the body is exposed to the wind. The body must be PhysicsBody.BodyType.Dynamic; otherwise a warning is logged and the call is a no-op. Sleeping bodies are woken automatically by Box2D when the per-shape force is non-trivial.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

## ApplyWind(WindInput)

Apply wind forces to this body's attached shapes. Forces are continuous (not impulses) and are computed per shape by Box2D using the drag/lift coefficients in `input`; this method is expected to be called every simulation step while the body is exposed to the wind. The body must be [PhysicsBody.BodyType.Dynamic](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/bodytype/dynamic.md); otherwise a warning is logged and the call is a no-op. Sleeping bodies are woken automatically by Box2D when the per-shape force is non-trivial.

```csharp
public void ApplyWind(PhysicsBody.WindInput input)
```

### Parameters

**** (\[WindInput]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/windinput)): The wind configuration. See [PhysicsBody.WindInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/windinput.md).

## ApplyWind(WindInput, ReadOnlySpan\<PhysicsBody>)

Apply wind forces to every body in `bodies` by iterating each body's attached shapes. The same [PhysicsBody.WindInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/windinput.md) is applied to all bodies. Each body must be [PhysicsBody.BodyType.Dynamic](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/bodytype/dynamic.md); non-dynamic or invalid bodies log a warning and are skipped. Forces are continuous (not impulses), so this is expected to be called every simulation step.

```csharp
public static void ApplyWind(PhysicsBody.WindInput input, ReadOnlySpan<PhysicsBody> bodies)
```

### Parameters

**** (\[WindInput]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/windinput)): The wind configuration. See [PhysicsBody.WindInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/windinput.md).**** (\[ReadOnlySpan\<PhysicsBody>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The bodies that wind should be applied to.

## ApplyWind(PhysicsWorld, PhysicsAABB, WindInput)

Apply wind forces to every dynamic body shape that overlaps `aabb` in `world`. The same [PhysicsBody.WindInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/windinput.md) is applied to all overlapping shapes. Shapes whose body is not [PhysicsBody.BodyType.Dynamic](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/bodytype/dynamic.md) are silently skipped. Forces are continuous (not impulses), so this is expected to be called every simulation step.

```csharp
public static void ApplyWind(PhysicsWorld world, PhysicsAABB aabb, PhysicsBody.WindInput input)
```

### Parameters

**** (\[PhysicsWorld]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsworld)): The world to query for overlapping shapes.**** (\[PhysicsAABB]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsaabb)): The world-space axis-aligned box describing the wind volume. Only shapes whose broadphase AABB overlaps this box are processed.**** (\[WindInput]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/windinput)): The wind configuration. See [PhysicsBody.WindInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsbody/windinput.md).
