Garry's Mod Wiki

Revision Difference

game.GetWindSpeed#566144

<function name="GetWindSpeed" parent="game" type="libraryfunc">⤶ <description>⤶ Return wind direction multiplied on speed of [env_wind](https://developer.valvesoftware.com/wiki/Env_wind) entity.⤶ </description>⤶ <added>2026.01.17</added>⤶ <realm>Shared</realm>⤶ <rets>⤶ <ret name="windDir" type="Vector">Return value is basically `windDir * windSpeed`.</ret>⤶ </rets>⤶ <args>⤶ <arg name="pos" type="Vector" default="nil">Optional arg that takes into account wind controllers with radius above `-1`. Without arg should use only the global controller (if one exists).⤶ <note>Position argument unfortunately will not do anything on `CLIENT` yet because the `env_wind` position is never networked to the clients.</note>⤶ </arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Visualization of wind direction:</description>⤶ <code>⤶ 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 )⤶ </code>⤶ </example>