#Why does the Particle System only render when Looping is set to true?

1 messages · Page 1 of 1 (latest)

ashen seal
hot adder
#

I don't need it looping to work

#

works for me

#

allthough I always Play() after emitting to be sure it runs

ashen seal
#

Really? I have only tried playing it from the Editor, didn't try calling the function from code yet

#

I will check it out

hot adder
#

lemme publish something

#

as it seems using particles is a frequent question, kek

ashen seal
#

That would be lovely
I could barely find anything on that topic

hot adder
#

here

#

it's a package

ashen seal
#

Thanks I will try it out

hot adder
#

so basically you just use SystemAPI.GetSingleton<ECSFXSingleton >()

#

and put it in jobs

#

and from within jobs you fx.Command(fxData,commandData)

#
    public struct Emit : IFXCommand
    {
        public int count;
    }
    public struct PlayData : IFXCommand
    {
        public bool includeChildren;
    }
#

two commands I built for myself

#

that are supported atm

#

you can check out source to see how to implement your own custom ones

#

oh and e in CommandData is prefab entity of converted particle system

#

to create it, just attach FXAuthoring monob to particle system prefab

ashen seal
#

That is awesome, I just tested it and it works perfectly, thanks a lot!

ashen seal
#

Hey @hot adder I have a quick question, have you experienced any MissingReferenceException errors when selecting the GO in Play Mode?
The Exception gets thrown when I put the Particle GO with the FXAuthoring + FXEmitterAuthoring in the Subscene and keep it selected in the Inspector in Play Mode

I am curious as to why the FXState unreferences the ParticleSystem when selected in Inspector + Play Mode
Is the Inspector doing something with the Pointers by any chance?

hot adder
#

it's the problem of package

#

because bakers recreate entities live

#

and package relies on them to act like in normal runtime

#

as in: loaded once

#

I did just for myself and I don't work with open subscenes, so... if you really need it - you can edit package to access particle systems via entity manager instead of registration

#

it'll be slightly slower though