0 like 0 dislike
144 views

Hi.

I want to preload FX and read http://wiki.popcornfx.com/index.php/FX_Loading_Management_(Unity_Plugin) .

Here is my code.

void Start()

{

  StartCoroutine(LoadPopcornEffects());

}

 

IEnumerator LoadPopcornEffects()
{
            
            for (int i = 0; i < popcornEffects.Count; ++i)
            {
                var path = popcornEffects[i];
                PKFxManager.PreLoadFxIFN(path);
                
                yield return null;
            }

            StartCoroutine(InitBattle());
 }

the variable 'popcornEffects' is List<string> and pathes of FX files are stored.

PKFxRenderingPlugin component is attached to Main Camera and active in a Scene.

But when I built android apk and started my game, there is a lag when FX is first instanced.

Is there anything I missed?

by pizzamon23 (120 points)

1 Answer

0 like 0 dislike

Hi,

It can seems a silly question, but is your script enabled at initialisation time ?

Cheers,
Maxime

by Maxime (5.4k points)
Yes. It is enabled and attached to gameobject. So Start function is called at initialisation time.
Okay, so i have a few more silly questions:
- Does this script attached to the gameObject that play the Fx ?
- Do you have the same latency in Unity on your computer ?
1. No it doesn't. FX is played from other gameObject.
2. No. I have no latency on my PC.
They are not silly questions. Thanks for your attention.
Hmmm.. Interesting..
Is it possible for you to send me your effect package to support@popcornfx.com ?
Mentionning my name (Maxime M) and the ticket title if possible.
I sent an email.
Thanks a lot.
...