Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

PhysicsShape.ApplyWind

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void ApplyWind(WindInput input);

Parameters

Parameter Description
input The wind configuration. See WindInput.

Description

Apply wind forces to this shape. Force is computed by Box2D using the shape's projected area, the wind velocity (PhysicsBody.WindInput.force) and the drag/lift coefficients in ; circles ignore lift. Forces are continuous (not impulses), so this is expected to be called every simulation step. The shape's owning 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.


Declaration

public static void ApplyWind(WindInput input, ReadOnlySpan<PhysicsShape> shapes);

Parameters

Parameter Description
input The wind configuration. See WindInput.
shapes The shapes that wind should be applied to.

Description

Apply wind forces to every shape in . The same WindInput is applied to all listed shapes. Each shape's owning body must be PhysicsBody.BodyType.Dynamic; shapes on non-dynamic or invalid bodies log a warning and are skipped. Only the listed shapes contribute to wind on their owning bodies; sibling shapes not in are left alone - this is the difference from PhysicsBody.ApplyWind, which processes every shape on each listed body. Forces are continuous (not impulses), so this is expected to be called every simulation step.