Fx
constFx:object
Defined in: client/api.d.ts:3068
Visual effects: Niagara and Cascade systems by asset path. spawn() is local to this client; the server’s Fx.create is the replicated form, and state() reads one of those here.
Type Declaration
Section titled “Type Declaration”catalog()
Section titled “catalog()”catalog():
object[]
Curated shipped effect systems (fire, explosions, smoke, weather, water, ambient, magic).
Returns
Section titled “Returns”object[]
destroy()
Section titled “destroy()”destroy(
handle):boolean
Destroys one locally spawned effect.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
A handle returned by spawn.
Returns
Section titled “Returns”boolean
destroyAll()
Section titled “destroyAll()”destroyAll():
number
Destroys every locally spawned effect.
Returns
Section titled “Returns”number
How many were still live.
getCollectionParameter()
Section titled “getCollectionParameter()”getCollectionParameter(
collection,name):number| {a:number;b:number;g:number;r:number; } |null
Reads one parameter of a material parameter collection as this client’s world holds it now.
Parameters
Section titled “Parameters”collection
Section titled “collection”string
A material parameter collection’s asset path.
string
A parameter the collection declares.
Returns
Section titled “Returns”number | { a: number; b: number; g: number; r: number; } | null
A number for a scalar parameter, a color for a vector one, or null when the path is not a collection or it declares no such parameter.
resetCollectionParameters()
Section titled “resetCollectionParameters()”resetCollectionParameters():
number
Puts back every parameter setCollectionParameter changed, to the value it had before this client’s first write.
Returns
Section titled “Returns”number
How many parameters were put back.
setCollectionParameter()
Section titled “setCollectionParameter()”setCollectionParameter(
collection,name,value):boolean
Writes one parameter of a material parameter collection in this client’s world: every material that reads the collection changes at once, the game’s own and a mod pak’s. The game may write the same parameter again, and the last write shows. It holds until resetCollectionParameters, a disconnect, or the world reloads. Throws a TypeError for a malformed value.
Parameters
Section titled “Parameters”collection
Section titled “collection”string
A material parameter collection’s asset path, e.g. ‘/Game/VFX/MasterMaterials/ParameterCollections/VFX_MP_Revelio.VFX_MP_Revelio’; a mod pak’s works too.
string
A parameter the collection declares.
string | number | { a?: number; b: number; g: number; r: number; }
A number for a scalar parameter, a linear color for a vector one; alpha defaults to 1.
Returns
Section titled “Returns”boolean
False when the path is not a collection, or it declares no parameter of the value’s kind by that name.
spawn()
Section titled “spawn()”spawn(
path,x,y?,z?,options?):number
Spawns an effect system at a world position on this client only. It lives until destroy, destroyAll, or the world reloads.
Parameters
Section titled “Parameters”string
Effect-system asset path, e.g. a Fx.catalog() entry.
number | Vector3Like
World-space X coordinate.
number
World-space Y coordinate.
number
World-space Z coordinate.
options?
Section titled “options?”Rotation in degrees and uniform scale (default 1).
pitch?
Section titled “pitch?”number
number
scale?
Section titled “scale?”number
number
Returns
Section titled “Returns”number
A local handle for destroy, or 0 when the path did not load as a Niagara/Cascade system.
state()
Section titled “state()”state(
networkId):FxClientState|null
This client’s replicated and applied state for one server-owned effect, or null before stream-in and after stream-out/destruction.
Parameters
Section titled “Parameters”networkId
Section titled “networkId”number
Server entity id from the server’s Fx.create.
Returns
Section titled “Returns”FxClientState | null