Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Bolt – Visual Scripting

Discussion in 'Assets and Asset Store' started by Ludiq, Jul 11, 2017.

  1. itsYloon

    itsYloon

    Joined:
    Nov 9, 2016
    Posts:
    6
    We have 2 more official tutorials up on our youtube channel!

    One of them covers integration of Bolt with Cinemachine, this is a great way to learn both Bolt and Cinemachine at the same time:



    The other covers the all new VFX Graph. In this video we use bolt to have thousands of particles react to music, a music visualizer of sorts:



    Enjoy!
     
    Mark_01, Garainis and Catsoft-Studios like this.
  2. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    516
    Hello,

    Do you know when Bolt 2 is planned to be out ? Are Bolt 1 tutorial a good way to learn Bolt ?

    Thanks
     
  3. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    551
    Hi Kiupe!

    We do not have an ETA for Bolt 2, but we provide regular Alpha versions on our download page: http://ludiq.io/bolt/download

    Bolt 1 tutorials are still a very good way to learn Bolt, and that knowledge will not be lost when Bolt 2 arrives. 80% of the concepts will still translate very well to the new version. :)
     
    HeadClot88 and Mark_01 like this.
  4. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    516
    Ok. As a not already Bolt user is it possible to test Bolt 2 alpha release or do I need a licence or something ?

    Thanks.
     
  5. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    551
    Hi Kiupe,
    You need a Bolt 1 license to download Bolt 2 alphas. Simply link your asset store invoice number to your Ludiq account to enable downloads.
     
  6. Iurii_L

    Iurii_L

    Joined:
    Dec 31, 2018
    Posts:
    1
    Hello!
    i am a complete noob in C# and Bolt is an amazing tool that lets me do simple scripting.

    My question is about RigidBody2D.Cast, I want to use it to check if my player will hit the wall on the next turn, since my game is turn-based i want to prevent the player from moving any further, closer to the wall, knowing that he will collide with it. I have background tiles with composite collider, as well as a collider on the player.

    I am 100% sure that my player is hitting the wall at the point when screenshot is done, but RigidBody2D.Cast keeps returning me zero.
    (I double check that collision is happening with regular ray.Cast, but i want to use collider shape instead for better precision)

    My idea on how it should work is based on this example, which i found on Unity Forum:

    Code (CSharp):
    1.    Rigidbody2D rb = GetComponent<rigidbody2d>();
    2.    RaycastHit2D[] hitResults = new RaycastHit2D[5];
    3.    int numberHit = rb.Cast(Vector3.right, hitResults, 5);
    4.    if(numberHit > 0)
    5.    {
    6.       print("Hit " + numberHit + " colliders.");
    7.       for (int i = 0; i < numberHit; ++i) print("Hit this: " + hitResults[i].collider.name);
    8.    }

    So in my flow macro I want to check too if number of collisions is grater than o and prevent player from moving further.

    Not sure what am I doing wrong and if it is the best way to do it, will appreciate any advise.
    Thank you, here is the screenshot:

     
  7. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    551
    Hi there!
    You're well on your way already!
    Instead of just logging the result of Cast, use the Branch unit to check an "if" condition, and use a Greater Than unit as the condition. In the Greater Than unit, plug the result of Cast as the first input, and leave 0 for the second.
     
  8. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,211
    Hey, @Ludiq !

    I'm author of Anti-Cheat Toolkit plugin and looks like we have some compatibility issues with Bolt.
    ACTk uses standard Task<TResult> from the System.Threading.Tasks namespace.

    Bolt adds System.Threading assembly to the project which does conflicts with standard netstandard assembly Unity uses:

    I'm afraid this can cause problems to many other third-party assets and to the regular project code which uses Tasks.

    If you have some specific workaround for this problem, it seems some customers are not aware of it.

    P.S. Looks like some customers could use .NET 3.x build in Unity 2018.3 with .NET 4.x scripting and this could cause this issue to appear. In such cases it would be great to warn customers they are using incorrect version to prevent false alarms from them.

    Cheers!
     
    Last edited: Mar 27, 2019
  9. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    551
    Hi Codestage!
    This is indeed an issue when using a .NET 3.x version of Bolt with a .NET 4.x setting in Unity.
    The solution is simply to download the .NET 4.x version of Bolt from our website (second link on the right):
    https://ludiq.io/bolt/download/1.4.1

    Cheers!
    Lazlo
     
    codestage likes this.
  10. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,211
    @Ludiq thanks for your quick reply, Lazlo!

    Yeah, this is what I suspected to happen and suggested to use .NET 4 version to the customer who had this issue ^^
    Seems to fix a problem, thank you for confirming this is a proper solution for the problem!

    Cheers,
    Dmitry
     
  11. RichardSim

    RichardSim

    Joined:
    Dec 15, 2013
    Posts:
    5
    Just to add to what codestage mentioned, in Unity 2019.1b10 Bolt conflicts with the Unity SRP due to the same issue. I'll try the .NET 4 version from the website, but is there a reason this isn't on the Asset Store?

     Library\PackageCache\com.unity.render-pipelines.core@5.7.2\Runtime\Volume\VolumeManager.cs(13,25): error CS0433: The type 'Lazy<T>' exists in both 'System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
     
  12. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    551
    Hi! You can fix this by using the .NET 4.x version of Bolt, which you can download from our website here:
    http://ludiq.io/bolt/download/1.4.2

    Edit: Sorry, read too fast. Yes, the reason why this isn't default on the asset store is because some projects are not compatible with 4.x, only 3.x. Most projects (except in special cases like yours) support 3.x, which is why it was chosen as the Asset Store version.
     
  13. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    594
    Hi,
    a probably strange question: Does Bolt generate code from the graphs?
    My intention is to be able to package some logic into AssetBundles; and my thinking is if the graphs are evaluated instead of just compiled out to regular scripts that should be doable, am i on the right path with bolt?
     
  14. williamian

    williamian

    Joined:
    Dec 31, 2012
    Posts:
    111
    Bolt 2 compiles to script at runtime. The caveat is, it will still require Bolt 2 to run in most cases. I suggest you join our discord channel for more in depth and timely Q/A on the subject.
     
  15. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    551
    Hi! Sorry for the late reply. Added a FAQ entry about it because it's a common question: https://ludiq.io/bolt/faq#assetbundles
     
  16. Zymes

    Zymes

    Joined:
    Feb 8, 2017
    Posts:
    106
    Looking forward to Bolt 2 and the C# generation. Mostly the reason why I never used visual scripting is the no access to code. Which probably will make me buy Bolt finally. :)

    A question however. I see most examples have been with start and update to run the game loop.

    I am however running a custom manager for the game loop simulation, because I need the game to be pausable but the UI still interactable and other stuff in the scene.

    Is it possible to hook up these graphs into my own game managers update() in Bolt 2?
     
  17. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    551
    Hi! Sure, in Bolt 2, anything that's a C# event will have a node generated for it.
    So if you have something like:

    Code (CSharp):
    1. public static class GameManager
    2. {
    3.     public static event Action update;
    4. }
    Then Bolt 2 will display a Game Manager: Update event in its node options.

    More info in the changelog for that alpha: https://ludiq.io/bolt/download/2.0.0a4#events
     
  18. Zymes

    Zymes

    Joined:
    Feb 8, 2017
    Posts:
    106
    I see, thank you.

    I am using this pattern right now but have not tested an event driven one. Maybe that is better. But am curious about the performance implications using events. Maybe hard to answer generally.

    The entire game basically runs in this loop.
     
  19. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    594
    UI isn't affected by Time.timescale, so you don't have to reinvent the unity update loop, btw.
     
  20. Zymes

    Zymes

    Joined:
    Feb 8, 2017
    Posts:
    106
    Another reason I want to use one dedicated manager to update the game loop is also this old post: https://blogs.unity3d.com/2015/12/23/1k-update-calls/

    Having multiple objects calling update is slower than one manager updating the same amount of objects.

    I hope we can do this in Bolt 2.

    Also with the code generation. What will happen with the graph if you modify the actual code?