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

Return wind direction multiplied on speed of env_wind entity.

Arguments

1 Vector pos = nil
Optional arg that takes into account wind controllers with radius above -1. Without arg should use only the global controller (if one exists).
Position argument unfortunately will not do anything on CLIENT yet because the env_wind position is never networked to the clients.

Returns

1 Vector windDir
Return value is basically windDir * windSpeed.

Example

Visualization of wind direction:

local color_red = Color(255, 0, 0) hook.Add( "PostDrawTranslucentRenderables", "MySuper3DRenderingHook", function() local eyePos = LocalPlayer():EyePos() + LocalPlayer():EyeAngles():Forward() * 100 render.DrawLine( eyePos, eyePos + game.GetWindSpeed( eyePos ), color_red ) end )