Garry's Mod Wiki

game.GetWindSpeed

  Vector game.GetWindSpeed( Vector pos = nil )

Recently Added

This was recently added in version (2026.01.17). It might only be available on the Dev Branch right now.

Description

Returns the wind's velocity at a given position, as influenced by current map's env_wind entities.

Arguments

1 Vector pos = nil
The point to get wind speed at.

If specified, wind controllers with windradius other than -1 will be taken into account, if the point is within their radius.
If omitted, only the global wind controller will be used (if one exists).

This argument will be ignored on the CLIENT realm and will be treated as nil because the position of env_wind is not currently networked to clients.

Returns

1 Vector windVelocity
windDir * windSpeed — the current wind direction multiplied by the current total wind speed.

See env_wind_shared.cpp#L255-L258 for how it's calculated.

Example

Visualizes the wind's speed and direction with a line in the center of the screen

local lineColor = Color( 175, 219, 245 ) hook.Add( "PostDrawTranslucentRenderables", "VisualizeWindVector", function() local windCheckPos = LocalPlayer():EyePos() + LocalPlayer():EyeAngles():Forward() * 100 render.DrawLine( windCheckPos, windCheckPos + game.GetWindSpeed( windCheckPos ), lineColor ) end )
Output: