Revision Difference
game.GetWindSpeed#566150
<function name="GetWindSpeed" parent="game" type="libraryfunc">
<description>
Returns the wind's velocity of the global or local [env_wind](https://developer.valvesoftware.com/wiki/Env_wind)(-s) at the current time (<page>Global.CurTime</page>).
Returns the wind's velocity at a given position, as influenced by current maps [env_wind](https://developer.valvesoftware.com/wiki/Env_wind) entities.
</description>
<added>2026.01.17</added>
<realm>Shared</realm>
<rets>
<ret name="windVelocity" type="Vector">The current wind direction multiplied by the current total wind speed.</ret>
</rets>
<args>
<arg name="pos" type="Vector" default="nil">
The point to get it at.
If specified, wind controllers with `windradius` above `-1` will be taken into account.
If omitted, only the global controller should be used (if one exists).
<note>Unfortunately bears no effect on `CLIENT` yet because the `env_wind` position is non-networked.</note>
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).
<note>Does not work correctly on `CLIENT` yet because the `env_wind` position is not networked to clients.</note>
</arg>
</args>
</function>
<example>
<description>Visualization of the current wind's vector:</description>
<code>
local color_blue = Color( 175, 219, 245 )
hook.Add( "PostDrawTranslucentRenderables", "VisualizeWindVector", function()
local pos = LocalPlayer():EyePos() + LocalPlayer():EyeAngles():Forward() * 100
render.DrawLine( pos, pos + game.GetWindSpeed( pos ), color_blue )
end )
</code>
</example>
Garry's Mod
Rust
Steamworks
Wiki Help