General VFX
VFX functions that all classes use
Short description
This page lists down functions used for commonly used for VFX by all classes, which may also include functions used in actual moves themselves (this is not a BM2 framework functions listings)
General framework
These are functions that each class uses in its VFX module.
Calling the module
local Lib = require(game.ReplicatedStorage.Modules.LibraryModule)
local Library = Lib()Visual effects
These functions are used to make visual effects.
Library.CreateEffect
Creates a part with a mesh associated with it and tweens the part.
Library.CreateEffect(PartProperties, Goals, TweenInfo, BetFunc, EndFunc)
-- Example usage
Library.CreateEffect(
-- Part properties, this is the part being created
{
MeshId = Resources.Meshes.WindMesh.MeshId,
CFrame = cfo,
Color = Color3.new(1, 1, 1),
Scale = Vector3.new(radius1 / 2, 1, radius1 / 2),
Offset = Vector3.new(-radius1, 0.25, 0)
},
-- This is the final outcome of the part, the goal
{
Transparency = 1,
Scale = Vector3.new(radius2 / 2, 1, radius2 / 2),
Offset = Vector3.new(-radius2, 0.25, 0),
CFrame = cfo * CFrame.Angles(0, math.rad(180), 0)
},
-- TweenInfo, which can be anything (in this case 0.4 second transition)
TweenInfo.new(0.4),
-- BetFunc, which is a function ran in the middle of the tween. Optional.
function(p, m)
p.CFrame = p.CFrame * CFrame.Angles(0, 0, 0)
end
-- There is EndFunc which runs at the end of the tween, but it's not
-- used quite often. EndFunc is also optional.
)Some settings can get a bit abstract.
Library.CloneEffect
Clones an effect to workspace.
Library.Tween
Tweens an object. Somewhat similar to CreateEffect.
Library.Create
Creates an object. A few other functions depend on this function.
Library.PlayCutscene
Used for playing cutscenes, such as Assailant's execution.
CFrames are usually set relative to the humanoid's root part. Delay may also simply be "Keep" if no delay needs to be specified.
Commonly used utilities
These functions are also used in VFX modules.
Library.GetFPSFactor
Get's a player's FPS factor. Needed for timing things correctly. To fully understand what it does:
The function returns a numerical value. Example usage:
Library.wait
Waits for the next frame.
Library.RunFor
Runs a function for a specified amount of time.
Library.InView
Checks to see if a specified position is within view.
Library.RandomAngle
Returns a random angle. If the minimum or maximum angle is not specified, by default the minimum and maximum angles returns will be -360 degrees to 360 degrees respectively in radians.
Library.NumLerp
Does linear interpolation between the variables a and b, with c being the interpolation factor.
Library.FindFloor
Used to find if there is a surface by raycasting. To fully understand what it does, since it does return two arguements:
Last updated
Was this helpful?