Wind Shake: High performance wind effect for leaves and foliage

Nothings modified, everything’s up to date. Tried playing around with the global wind and that doesn’t help (it makes it worse with more wind, the effect becomes more noticeable)

Is there a way to have a group of anchored parts in a model sway in the wind together?

How can I increase the width of the trail?

Can I get some help, I purchase the Wind Editor Plugin and it doesn’t seem to be working? It works in the preview but when in game nothing happens, what am I doing wrong?

4 Likes

Amazing asset! Also, is it possible to get the wind shake plugin for robux?

If yes please do let me know the price, I’d love to have it!

Someone has already asked this, so I will answer for him, it is not a possibility, as roblox takes most of what he earns.

How did you make it so that the leaves are still shaking without the leaves detaching from the trunk?

I’m also having the same problem. I installed it per the instructions and while it appears to work in the viewport, it doesn’t actually work when running the game. Did you ever figure out what was wrong?

Ha. Nevermind I literally just figured it out. If anyone else is reading this with the same question, you have to click on wind direction in your settings and give it a value greater than 0 (which was the default for some reason).
image

3 Likes

Some suggestions for the plugin:

  • The plugin still has all connections and functionality working even when it is closed. This is less than ideal, and when selecting large models with many parts in them can cause lag spikes. This is especially a pain point because it’s a local plugin, meaning to even disable it I have to either delete the plugin files or move it somewhere else on my machine. Not convenient.


    (the plugin cloning an entire section of a map despite being closed)

  • The imported WindShake script has MathWorkspaceWind = true. This is strange, because it means any settings I made using the plugin will just be ignored by default anyway. This took me about 10 minutes to notice, wondering why the trees in my game weren’t moving.

  • The height of the preview window is clamped, for some reason? I don’t understand why even when I scale the plugin bigger, I’m still limited to seeing a tiny view of a large selection of trees.


    (large window, >half of it totally empty space)

Have you found a fix for this? I also agree that it seems unrealistic.

When I set the winds to around 40 speed and the wind strength to 3 it looks nice like strong winds but as soon as I get within a certain distance between my character and the tree it begins to “jitter” and shake literally but as soon as I step a bit back or forward it returns to normal.

A note to this is I only see this happen when I have Roblox wind enabled alongside Windshake, so that might be the issue. But yet again, the trees only begin to move when Roblox wind is on.

1 Like

Additional note… I turned off Roblox’s wind and it still does the same thing… jittering. Is there any fix to this? I need higher wind speeds for my game and the only way I can somewhat achieve that is by setting the wind power to over 0.3 @boatbomber

having an issue where things tagged aren’t affected (some are, some aren’t)

I followed all of the steps but it seems to have like a laggy effect when rotating, does anyone know how to fix this?

1 Like

Added windshake yesterday and was working fine. Today i was testing and most of the trees and grass are blinking! LOL

1 Like

could you share your code, idk how to make mine stop working and resuming

Sorry for the late reply. Sure! It’s thankfully simple to setup and both modules work well together.

Breakdown

Firstly we need our variables for each module & the zone we’re using to track.

--// Modules used
local WindShake = require(script.WindShake)
local ZonePlus = require(script.Zone)

-- // Get container
local WindZoneContainer = workspace.WindZone

-- // Construct Zone
local MainZone = ZonePlus.new(WindZoneContainer)

Next, we have to construct the connections for entering and exiting the zone we’ve created. When entering the zone, we can pause the WindShake effect using the Pause() function if the WindShake module is currently running.

--// Construct Zone Connections
MainZone.localPlayerEntered:Connect(function()
	if WindShake.Running then
		WindShake:Pause()
	end
end)

Finally, when exiting the zone, we can check if the WindShake module has been initialized. If it hasn’t, initialize. If it has, resume.

MainZone.localPlayerExited:Connect(function()
	--// Check if WindShake has ever been initialized. If it has, resume. Otherwise initialize
	if not WindShake.Initialized then
		WindShake:Init({MatchWorkspaceWind = true})
	else
		WindShake:Resume()
	end
end)

The WindShake effect should now pause and resume based on entering and exiting a designated zone. Hope this helps! :smile:

Full Code
--// Modules used
local WindShake = require(script.WindShake)
local ZonePlus = require(script.Zone)

-- Get container(s)
local WindZoneContainer = workspace.WindZone

--// Create zone
local MainZone = ZonePlus.new(WindZoneContainer)

--// Construct Zone Connections
MainZone.localPlayerEntered:Connect(function()
	if WindShake.Running then
		WindShake:Pause()
	end
end)

MainZone.localPlayerExited:Connect(function()
	--// Check if WindShake has ever been initialized. If it has, resume. Otherwise initialize
	if not WindShake.Initialized then
		WindShake:Init({MatchWorkspaceWind = true})
	else
		WindShake:Resume()
	end
end)

--// Initialize on join (optional)
WindShake:Init({MatchWorkspaceWind = true})
Video

https://www.youtube.com/watch?v=Wv6A2c9a3sw

1 Like

Hi
Smoothly updating the properties seems to cause jittering problems on the meshes.

My guess is that it constantly re-initializes the CFrame once the attributes are changed. Ideally it shouldn’t reset those, but just proceed the movement where it’s currently at, and use a faster speed/updated wind direction.

Here’s the localscript I’m using for the smooth change:

--[[
	Realistic global wind gusts (strength changes).
    For grass terrain wind effect, also the custom WindShake reacts to this (realism)
    src: https://create.roblox.com/docs/environment/global-wind
]]
local gustCycleDelay = 4 -- 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 = Vector3.new(5, 0, 2) -- Base wind speed and direction
local gust = Vector3.new(5, 0, 5) -- 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
task.wait(gustCycleDelay)

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
		task.wait(dg)
	end
	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
end

Thanks