Verse: powerups have no Clear()

Programmatically assigning a Powerup to a user without a duration can never be removed in verse. In UEFN, we have a Pickup() and Clear() function which allows you to apply and remove the powerup from a user.

But in verse, we only have the Pickup() exposed on visual_effect_powerup_device

Verse API:

@SoyDallas Thank you for your feedback. While I cannot guarantee a response, I can confirm that this has been forwarded to the appropriate team.

4 Months later and still no Clear() for vfx powerup device in Verse, quite disappointing

1 Like

One way to work around this is to spawn an empty powerup VFX on the player, on the same VFX index.

6 Likes

You’re a legend. Simple and brilliant solution. I was going to use verse to trigger a button to trigger the “clear” function, but this feels way simpler and probably more reliable.

Something I was doing to prevent the vfx bug that I think was working (been like 5 months now, can’t entirely remember) was set the duration to 0.0 and then pickup. If this does work likely could just use a function that checks if they have the powerup, if not it can set it to a very long time, and if they dont set it to 0.0 and pickup. Just can’t set infinite on the device itself.
I’ll test this later because it would reduce the need for more devices if it works. I could have sworn this is what i did to prevent that bug where when eliminating a player that had a vfx pickup it would bug out so I would check if damage was lethal and do this trick to prevent that.
:man_shrugging: will check a bit later.

Bump

Good workaround! But requires to use indexes and won’t work in a dynamic system that doesn’t make use of indexes. A proper Clear() function with an agent parameter should be added into Verse, it’s necessary.

Yeah, we need the Clear function exposed in Verse, along with everything else. It’s incredibly frustrating that there is not anywhere close to parity between the settings available in UEFN and the Verse API, and it makes for messy development with functionality split weirdly between the two.

Anyway… Not sure if this will help with your situation, but I was able to do it without indexes like this.

Add two VFX Powerups. For clarity, I’ll call them:

  • VFX Powerup Effect
  • VFX Powerup Effect Clear

In your Verse code, use the Pickup function as necessary for each of them. Execute the Pickup function in your Verse code on the VFX Powerup Effect Clear device where you want to clear the the VFX Powerup Effect.

In UEFN, apply the following settings:

VFX Powerup Effect > User Options - Functions: Add Clear function set for VFX Powerup Clear for an On Item Picked Up event.

VFX Powerup Effect Clear > User Options - Functions: Add Clear function set to VFX Powerup for an On Item Picked Up event.

In my use case, I also had to enable Infinite Effect Duration and set Time to Respawn to 0.0.

Hope this helps.