Triggering Visual Effects in Unity

Sdílet
Vložit
  • čas přidán 23. 08. 2024
  • Continuing from Previous Video:
    • Particle Bursts with V...
    If you want to start from the beginning, click here:
    • Getting Started with V...
    Finally, we look at how to trigger our particles during gameplay. We briefly talk about a few different approaches, such as child object triggering, Create/Destroy and Object Pooling.
    00:25 - Child Object Triggering
    01:20 - Create/Destroy Triggering
    04:52 - Object Pooling (brief summary)
    06:19 - Triggering Visual Effect in Script
    11:13 - Create Destroy Method (option)

Komentáře • 9

  • @terencerixon3050
    @terencerixon3050 Před 2 lety +3

    Really appreciated this video. Clear, concise and very knowledgeable. Helped me out a bunch. Have subscribed and will be working through all of your content.

  • @animationsoftyrex5442
    @animationsoftyrex5442 Před 4 měsíci +3

    The best (and only one, that really helped) tutorial about this topic. i used a vfx to make particles and this showed me how i can use this in certain moments in my game.

  • @conortapley7070
    @conortapley7070 Před rokem +2

    To get when the visual effect finishes make a float in the vfx graph called something like "Lifetime" connect it to B in "Set LifetimeRandom" then in your script before you call play on the visual effect set the "Lifetime" property you created to the maximum lifetime you want like this "effect.SetFloat("Lifetime", x);" then you can destroy it after whatever x value you set

    • @conortapley7070
      @conortapley7070 Před rokem

      Or even better you can use effect.GetFloat("Lifetime") to get the length set in the properties

  • @hawwka
    @hawwka Před rokem +1

    Nice content!

  • @austinglueck2554
    @austinglueck2554 Před 8 měsíci +1

    Hey, I don't expect an answer since this video is so old, I have a very specific problem where when I call visualEffect.Play(); in a function on another script, the effect isn't called. Everything is set up appropriately, the variable types are all correct, but the only time I can get the vfx to actually play is when I call the play function in the update of the object with the vfx variable itself, do you have any idea what could be going on here?
    I've tried having the effect play be called in a function on the script with the visual effect, but even when that other function is called, vfx.Play(); still isn't called.

  • @Zihenroy
    @Zihenroy Před 3 lety +1

    Anyway thanks for showing all the ways. Im interested in spawning way but it causes lag for some reason, even if theres like burst of 50 particles lol

  • @Zihenroy
    @Zihenroy Před 3 lety

    Instantiating prefab works as it should but it lags 1000 times more than old particle system :/ Wonder if im doing anything wrong
    EDIT: I use "GameObject newBurstEffect = Instantiate" instead of "VisualEffect". Maybe that causes lag?

  • @christopherwalka6338
    @christopherwalka6338 Před 3 lety

    It might be possible to either 1: Use .aliveParticleCount to determine when the effect has completed playing or 2: Get the max lifetime property using .HasFloat & .GetFloat? These are untested, just quick ideas from looking through the documentation. I've also seen something interesting about triggering other particle spawns using GPU Events but they are currently experimental and also idk if they are able to be used for hookups outside of the VFX system.