Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Fading in an entire particle system

Discussion in 'Editor & General Support' started by helgarddebarros, Jan 6, 2018.

  1. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    125
    I have a sandstorm particle effect. I want my player to walk into an area, and when he hits the trigger, the sandstorm will start, and last for three minutes.

    So if I set my duration to three minutes, the sandstorm fades out perfectly fine after three minutes.

    But at the start, when he hits the trigger, the sandstorm starts immediately, which looks very fake. I want the entire particle system to fade in over say 30 seconds.

    So I don't want to change the fade or transparency of the individual particles, but of the entire system. I have tried playing with the start lifetime, but that doesn't do the trick. I have found a few scripts where people have tried to do this but they date from 2012 and 2013 and they aren't working either.

    Any ideas of how this can be done?

    PS I am not a very good programmer....
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,846
    It's probably best to address global effects like that (for now) in the shader. So the shader's tint colour or a multiplier would handle this easily. In this case, the standstorm effect would have no fade in or fade out, and the timing would be handled script side instead.

    If you are using the standard particle shader, it should be possible to just animate the material settings.

    Unity plans on adding global effects I think that would cover these use cases better @richardkettlewell
     
    karl_jones likes this.
  3. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    125
    I think for now the easiest solution would be when the player hits the trigger, the sandstorm starts, but it is below the ground. Then it moves up to its proper height over say thirty seconds, and plays until it fades out after three minutes. This way it will look quite natural, the dust will start at ground level and rise, and fade out at the end of the storm. A little easier than written code at the moment.
     
  4. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    125
    OK, got it working perfectly, sandstorm sound fading in and out as well, so it looks and sounds quite natural.

    But I am getting this warning:

    Particle System is trying to spawn on a mesh with zero surface area

    Google and forum search doesn't give any results, and I don't know what it means. Any idea?
     
  5. GameJob2017

    GameJob2017

    Joined:
    Mar 1, 2017
    Posts:
    16
    Hi helgarddebarros,

    I have got the same warning message "Particle System is trying to spawn on a mesh with zero surface area", but I don't know what it means.

    Have you been able to figure out what it means and how to fix it ? If yes, please share the solution with us.

    Thank you very much. :)
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,554
    Particle System is trying to spawn on a mesh with zero surface area

    It means your mesh has zero surface area and you are not using vertex placement mode. Does your mesh have any triangles? Surface area is the total surface area of all triangles on your mesh. Either switch to vertex mode or add some triangles.
     
    helgarddebarros likes this.
  7. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    125
    @GameJob2017 I turned off all my particle effects and turned each one on in turn until I found out which one was sending the message. Then I looked inside that and under the Render Mode it said mesh, but there was no mesh. I added a quad, and that fixed the problem.
     

    Attached Files:

    • 94.png
      94.png
      File size:
      44.8 KB
      Views:
      859
    karl_jones likes this.
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,554
    Oh so you get that message when nothing is assigned to the mesh field? Hmm I think we should improve that error message. Can you file a bug report for this please? We can try and improve the error message.
     
  9. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    125
    Mmm, can't get the bug report to work. But here is a quick way to reproduce the error.

    Download this product:
    https://www.assetstore.unity3d.com/en/#!/content/56959

    Open the included sample scene.

    Click on the "Watertop_Circle_Swell_A" part of the prefab.

    And the warning messages will start.
     

    Attached Files:

    • 100.png
      100.png
      File size:
      20.9 KB
      Views:
      632
    • 101.png
      101.png
      File size:
      10 KB
      Views:
      596
    • 102.png
      102.png
      File size:
      76.4 KB
      Views:
      654
  10. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    246
    It would also be nice if the error message would specify WHICH particle system is having this problem, and potentially highlight it when the error message is clicked. ;-)
     
    resequenced likes this.
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,554
    Yes I agree. Those are the worse type of error messages when you have to hunt down where it's coming from!
     
    plmx likes this.
  12. andrewjepsen

    andrewjepsen

    Joined:
    Jan 12, 2016
    Posts:
    3
    I've seen this error when assigning a MeshRenderer from code and the MeshRenderer assigned was marked (accidentally) to static batch (Note that in my example the MeshRenderer was actually being statically batched, not just marked to). It makes sense that this doesn't work but the issue wasn't immediately obvious from the error message.
     
  13. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,554
    If you encounter error messages that are not clear then it's perfectly valid to file a bug report. We would consider this a bug.
     
    hippocoder likes this.
  14. avi9111

    avi9111

    Joined:
    Feb 24, 2016
    Posts:
    31
    I did get a mesh. but still got this msg. how could i fix my mesh that with zero surface area?
     
  15. yannminh

    yannminh

    Joined:
    Jul 1, 2007
    Posts:
    38
    Hello, I get the same console message, with the same asset store object "realistic Waterfall"... did someone solve the problem ?

    Thanks.. :)
     
  16. yannminh

    yannminh

    Joined:
    Jul 1, 2007
    Posts:
    38
    Ok, If that help, I change the render mode in the particle inspector as Billboard, and no more console alert with the message : Particle System "is trying to spawn on a mesh with zero surface area" and it works fine... no difference beetween mesh rendering or billboard rendering..

    But if I use Horizontal billboard, I have this alert message in the console again...