The fsVfxSpawnInWorld function can be used to span a visual effect in the world.

 

Syntax

 

Members

 

Return Values

The function returns a VFX ID which can be used in most of the other VFX API functions. If something has gone wrong and the function fails, FSVFXID_NULL will be returned. The VFX creation may fail if:

  • the pointer to strGuid is not valid
  • the VFX associated with the GUID is not loaded in the game (possibly because the VFX doesn’t exist)
  • the VFX has been spawned to far away (ie: further than all the MaxEmissionDistance of the emmiters)

 

Example
FsVec3d lla = { 36.151591, -5.340841, 58.154 };
FsVec3d pbh = { 0, 0, 0 };
FsVfxGraphParam graphParams[3];
graphParams[0].paramName = "ColorR";
graphParams[0].RPNExpression = "0";
graphParams[1].paramName = "ColorG";
graphParams[1].RPNExpression = "0";
graphParams[2].paramName = "ColorB";
graphParams[2].RPNExpression = "1";
g_SpawnVars.fxInWorldId = fsVfxSpawnInWorld("AAF9ECBE-C092-429A-877B-D41357D1E519", lla, pbh, -1, graphParams, 3, FsWorldReferenceGeoid);

 

Remarks

When spawned a VFX instance will start playing automatically. Also note that all VFX that you spawn in the world should be destroyed when no longer required using the fsVfxDestroyInstance function.

 

0/255