Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[SHOCKING] Procedural Lightning - Fastest, AAA Quality, Dozens of Prefabs and ⚡UNLIMITED POWER!⚡

Discussion in 'Assets and Asset Store' started by jjxtra, Apr 25, 2016.

  1. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi, I'm trying to set up the force lightning spell to star from one point and end to another point: I'm using the demo scene DemoSceneSpells to make some tries: I checked the configuration of the prefab of the spell and it's the same of the instance of the same spell in the scene, but my instance doesn't show at all in the scene, even if everything seems ok to me: how can I activate the lightinig? Thanks. I enclose a screenshot where I circled in red the ForceLightningSpell I added that doesn't appear. Unity 2020.3.21f with URP 10.6.0.
    upload_2021-11-4_15-2-36.png
     
    Last edited: Nov 4, 2021
  2. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    Were you able to resolve this? Sorry Unity has a forum bug where it stops sending email notifications until I unsubscribe and resubscribe...
     
  3. Stephanommg

    Stephanommg

    Joined:
    Aug 18, 2014
    Posts:
    72
    Activating multi threading in a LightningBoltShapeConePrefab doesn't do a thing. All jobs are idle in the profiler.
     
  4. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    Sent 2.6.0 update that fixes some issues with multi-threading. On desktop especially newer cpu like i9-12900k the difference is less noticeable.
     
  5. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    Also the multi-threading does not use Unity's job system, it uses background threads. Code was written years before Unity job system was usable.
     
  6. Stephanommg

    Stephanommg

    Joined:
    Aug 18, 2014
    Posts:
    72
    I think there is a bug in the end width control of the lightning controllers. The end width multiplier only works when the fork end width > 0, and the fork end width modifies both the end widths of the fork and the end width of the main trunks.
     
  7. Stephanommg

    Stephanommg

    Joined:
    Aug 18, 2014
    Posts:
    72
    Another apparent bug. When you duplicate a GameObject with a lightning controller, the lightning of the copy gets "messy" when you move the copy. It stays in place while the GameObject is moving. It also sometimes create another visual copy of the lightning.
     
  8. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    My issue is, as soon as I start recording with unity recorder the procedural lightning doesn't appear, no matter I checkbox game time or multi-threading. Unity Recorder = off > hit play in editor and it works. Could that be it, what you are talking about? Because if yes, it sounds like there is no solution for me then O_O
     
  9. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    Apologies for not responding the last few months on this forum. Several things have made life very difficult:
    - Nasty cold in March
    - Influenza in April
    - Covid in May
    - Unity bug that has existed for years stops emailing forums post notifications

    I am trying to get my health back and it's slow going, I will try to remember to re-enable the email notifications for the forum more often...
     
  10. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    66
    Hello - is there a way to set the scale of the lightning? I really want to do a "lightning between two fingers" effect, but the lightning is terribly big no matter what parameters what I use. Setting the GameObject's scale doesn't seem to work either. :(
     
  11. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    There is a demo scene for this. It will keep lightning looking nice between twio moving objects.
     
  12. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    66
    Yes, but when you put two objects extremely close (say 0.05 unit), the lightning generated between them is so thick like a rectangle instead of scaled to fit the distance. Do you know if I can tune any parameters to adjust the lightning width?
     
  13. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    The script has a trunk width parameter that could probably get toned down, I will look at adding this to the asset, but for now you could lower it yourself by computing the distance and lowering it.
     
    TigerHix likes this.
  14. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    There is a max scale property on the transform script. Try setting it to 1 or 2.
     
  15. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    66
    Cool thanks! So, is this param not exposed in inspector? Because I swear I tried to adjust every parameter on the inspector yesterday :p I assume it is a non-serialized field in LightningBoltPrefabScript?

    I recall there was a trunk tint color but indeed didn’t see a trunk width param.

    EDIT: Now I see it - it's a private field exposed by the editor script which I removed. Thanks!
     
    Last edited: Mar 8, 2023
    jjxtra likes this.
  16. Rand_D

    Rand_D

    Joined:
    Oct 24, 2017
    Posts:
    43
    Hi, Im trying to make a spell that is somewhat like this video that you posted. The lightning will find a new target and jump to it. How do I make it with this asset ? Also how can I check for collision when the spell hits a target?
     
  17. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    39
    Great asset! anyway I can add emissive to the material. I'm using URP. Thanks!
     
  18. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    Intensity parameter should do it. Then set the color to your desired value.
     
  19. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    39
    Thanks @jjxtra

    Intensity did indeed work but I had to remove the range on it. It turns out, we have some custom volumetric rendering that is dampening the emissions so things need to be extra emissive.

    The lightening looks great so thanks for the asset and the support! BTW I bought it in 2019 and am just integrating it now. lol
     
  20. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,452
    Better late than never!
     
  21. slippyfrog

    slippyfrog

    Joined:
    Jan 18, 2016
    Posts:
    39
    Hello, I'm getting a Deadlock OnDestroy when existing the game (Playmode stop)

    upload_2023-9-13_17-13-35.png


    I'm not doing anything outside of ordinary. I do use a few other assets that use their own threads. (https://arongranberg.com/astar/ and perhaps DoTween).

    Any ideas on what this could be?

    I'm on URP on a Mac with Unity 2022.3.X.

    It seems to happen every few times I press stop to exit play mode.

    Thanks in advance.

    Also I dont use threads in my code whatsoever but use Async loads for scenes, etc.

    Steps:
    Enter play mode
    Exit play mode
    Notice that the game sometimes soft locks.

    Observations:
    pressing the pause in the debugger shows the code is blocking on the
    TerminateAndWaitForEnd method of LightingBoltDataStructures.cs.
     
    Last edited: Sep 13, 2023