Search Unity

Particle System and OnBecomeVisible

Discussion in 'Scripting' started by Crazy Robot, May 14, 2013.

  1. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hello,

    I want to turn off particle systems when they are not visible to the camera, so I tried OnBecomeVisible and OnBecameInvisible, but they are not being called with just the particle system renderer. I have to attach a mesh renderer to make it work.

    Is this normal or are Shuriken Particles automatically turned off when not visible?

    I'm using this on mobile to save unnecessary CPU calculations.

    Thanks,
     
  2. Synergetik

    Synergetik

    Joined:
    Apr 15, 2013
    Posts:
    4
    Sorry to so i'm fairly new to programming so I can't give you your desired answer, however another another solution could be to child it to a gameobject with a mesh collider so the becamevisible and invisible functions work and have the particle object disabled/ enabled. Sorry this wasn't the answer you were looking for but somethings better than nothing :)