windLines
windLines is a fork of boatbomber's wind lines module, however it is heavily refactored and has a few slight changes in behavior. Overall, it is a module for creating wind line effects.
windLines.onEffectStarted:Connect(function()
print("WindLines effect started")
end)
windLines.onEffectStopped:Connect(function()
print("WindLines effect stopped")
end)
windLines.start()
Types
WindLinesConfig
interface
WindLinesConfig {
lifetime:
number?
--
The life time of wind lines.
speed:
number?
--
The speed at which wind lines move.
spawnRate:
number?
--
The rate at which wind lines are created.
raycastParams:
RaycastParams?
--
A RaycastParams
object, to be used in determining if the player is under a roof or not.
}
This is a config template, none of these members are required in the config table when configuring windLines through windLines.setConfig, however the config table must not be empty!
DefaultWindLinesConfig
interface
DefaultWindLinesConfig {
lifetime:
3
direction:
Vector3.new(1,
0,
0)
speed:
6
spawnRate:
25
raycastParams:
nil
}
This is the default config template that windLines initially uses. You can configure windLines through windLines.setConfig.
Properties
onEffectStarted
SignalRead onlywindLines.onEffectStarted:
Signal
<
>
A signal which is fired whenever the wind lines effect starts.
onEffectStopped
SignalRead onlywindLines.onEffectStopped:
Signal
<
>
A signal which is fired whenever the wind lines effect stops.
Functions
effectStarted
windLines.
effectStarted
(
) →
boolean
Returns a boolean indicating if the wind lines effect is started.
started
windLines.
started
(
) →
boolean
Returns a boolean indicating if windLines is started through windLines.start.
setConfig
Sets the current config of windLines to newConfig
, so that this new config will be used for wind line effects.
start
windLines.
start
(
) →
(
)
Starts up the wind lines effect.
Custom behavior
If the player is standing under a roof, then the wind lines effect will be stopped for realism purposes and this behavior cannot be toggled. However, you can adjust this behavior through windLines.setConfig through the RaycastParams member, since ray casting is used in determining if the player is standing under a roof.
For e.g, the following config does not consider descendants in the filteredPartsFolder
folder as roofs,
so if a player stands under them, the wind lines effect will not be stopped:
local Workspace = game:GetService("Workspace")
local filteredPartsFolder = Workspace.SomeFolder
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {filteredPartsFolder}
windLines.setConfig({raycastParams = raycastParams})
windLines.start()
stop
windLines.
stop
(
) →
(
)
Stops the wind lines effect.