Announcement

Collapse
No announcement yet.

Persistent particle system component on a weapon?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Persistent particle system component on a weapon?

    Hello. I have this shell ejection UTParticleSystemComponent on my weapons that spit out shell casings when the weapon is fired. The casings land on the ground but disappear when the weapon is put away. How would you make them persistent and not disappear when the weapon is put away? I can't use the emitter pool since I need to be able to change the FOV the particle system is rendered with.

    #2
    Set the lifespan of the module to 0? Turn off kill on deactivate?

    Comment


      #3
      Couldn't find a setting for the lifespan of a particle system module and I tried setting the kill on deactive on the emitter to false, but it didn't work. Any other ideas? Something seems to happen to the attached components of a weapon when it is put down.

      Comment


        #4
        Lifespan is under the required part of the particle module. Set it to 0. Set lifetime to 0 as well.
        http://udn.epicgames.com/Three/Parti...uired%20Module

        Comment


          #5
          Nope, they still disappear when I put down the weapon.

          Comment


            #6
            The thing is, once you un-equip a weapon with the default inventory system, it stops existing, it cannot do anything anymore.
            What you need to do is work around that somehow, for instance managing the particle system component in your pawn class instead. Of course, managing weapon stuff in the pawn class is sub-optimal, but it works.

            Comment


              #7
              Actually, I don't think it stops existing, as one of the performance workarounds that I've done to the default weapon system is to completely shut them down when they are not in use (some of you might be surprised by how much CPU time a weapon that isn't in use can take up). However, the mesh is detached, which probably causes anything that is attached to it to become inactive, or dead, or whatever. If the attached emitter comes back to life when you bring it back up, it's probably something like that. Having tons and tons of extra particles hanging out though is probably far more concerning for performance reasons than a few ticks spent doing nothing on a dead weapon

              it does sound like you may want to have the particlesystemcomponent as part of the pawn, if you need these to persist for significantly longer periods, though. Or *shudder* make their results seperate actors.

              Comment


                #8
                What if I use the WorldInfo's emitter pool to spawn an emitter with a custom lifespan? Then the particle system component would be created and updated somewhere other than in the weapon itself? The weapon would still hold a valid reference to the PSC even when cycled, right?

                Comment

                Working...
                X