fsVfxIsInstancePlaying always false


Frequency: Consistently

Severity: Blocker

Context: checking if an effect is playing on a non-ego aircraft (ai)

Bug description: Testing the effect with fsVfxIsInstancePlaying always returns false even if the effect is currently playing. Additional testing reveals that none of the other functions work for effects attached to non-ego simobjects. It’s not possible to move or despawn the effect either.

Repro steps:

  1. Inject an effect on a non-ego SimObject
  2. Run fsVfxIsInstancePlaying with the ID returned from the creation of the effect.

Hello @runshotgun

When you say the effect “is currently playing”, you mean the ai is in visual range and you see the effect?


Yes it was in visual range and the particles are emitting (camera was right next to it)

1 Like

Hello @runshotgun

We are not able to replicate this issue yet.
Here’s a modified version of the Spawn.cpp file from the VFXAircraft sample.
Spawn.cpp (15.2 KB)

It adds a button to spawn effects on nearby AIs. fsVfxIsInstancePlaying and fsVfxSetOffset are called continuously on these effects and are behaving as expected in our test scenario.

If you have a sample that demonstrate your problem, send it and we’ll have a look.


1 Like

Thank you for the sample and the time it took to create it. Please make it part of the samples :wink: I walked through your code to try and find the issue on my end and threw a few things at the wall.

TLDR, it works as expected, it was an error on my side.

The issue was, I am using a vector<pair<int, FsVfxId>> objects; to track object and vfx id pairs.

I was using (not working):

if (!fsVfxSetOffset(objects[i].second, { 0,0,0 })) {

and now (working):

FsVfxId effect_id = objects[i].second;
if (!fsVfxSetOffset(effect_id, { 0,0,0 })) {

The joys of C++.