Wind values change but grass doesn't get effected?

  1. What do you want to achieve? Keep it simple and clear!
    I’m trying to make wind change via a script. Simple.

  2. What is the issue? Include screenshots / videos if possible!
    Grass doesn’t get effected by the wind change.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried changing the values to extremes and lengthening the duration that it stays that way.

Server Script:

---- Variables ----
local GlobalWind = game.Workspace.GlobalWind
local OriginalWind =, 0, 50)
local InfluencedWind =, 0, 500)

--Remote Events
local StartWindEvent = game.ReplicatedStorage.StartWind

---- Code ----
GlobalWind = OriginalWind

	GlobalWind = InfluencedWind
	GlobalWind = OriginalWind

The outputs prints:
25, 0, 50
200, 0, 500
25, 0, 50

GlobalWind is not a path to the property, but a copy of the original value, saved in a variable.

workspace.GlobalWind =, 0, 500)

Analogous case:

print(workspace.NumberValue.Value) --> 5
local numberValue = workspace.NumberValue.Value
print(numberValue) --> 5 (not value base)
1 Like

So how would I change the value like this code does it;

local gustCycleDelay = 5  -- Max duration between gust cycles in seconds
local gustCycleDuration = 3.5  -- Duration of each gust cycle in seconds

-- During each gust cycle, a portion of "gust" will be added to "baseWind" in a ramped fashion
local baseWind =, 0, 2)  -- Base wind speed and direction
local gust =, 0, 10)  -- Gust speed and direction
local gustIntervals = 100  -- Number of iterations used to calculate each gust interval
local dg = gustCycleDuration / gustIntervals
local dgf = dg / gustCycleDuration

-- Set global wind to base wind initially
workspace.GlobalWind = baseWind

-- Wait delay amount before starting gusts

while true do
	for i = 1, gustIntervals do
		local f = math.sin(math.pi * dgf * i)  -- Use sin() function to ramp gust
		workspace.GlobalWind = baseWind + f * gust  -- Set global wind to base wind + gust
	workspace.GlobalWind = baseWind  -- Reset global wind to base wind at end of gust cycle
	task.wait(math.random() * gustCycleDelay)  -- Wait a random fraction of delay before next gust cycle

The above code works (From documentation) while mine doesn’t. Why? (After changing the value to workspace.GlobalWind instead of game.Workspace.GlobalWind)

workspace is just a global variable for game:GetService("Workspace"). Saving workspace.GlobalWind to a variable does not save the path, but rather the value. If the value is changed, solely the variable is, not the property of workspace.

local OriginalWind =, 0, 50)
local InfluencedWind =, 0, 500)

local StartWindEvent = game.ReplicatedStorage.StartWind

workspace.GlobalWind = OriginalWind

	workspace.GlobalWind = InfluencedWind
	workspace.GlobalWind = OriginalWind
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.