How to Spawn a Powerup that knows when the Player Overlaps it

It seems like dynamically spawning a vfx powerup using this tutorial (Spawn devices dynamically using Verse! (And a bit of cursed tricks) | Community tutorial) would solve my problem, but I’ve encountered various problems trying to apply it to my use case.

  1. Spawned devices seem to revert to default settings (so pickup radius gets reverted).
  2. If instead I use a volume or mutator zone device, I first get a validation error. Then when I hit autofix it seems to work. However, when I start my game and spawn my volume, the FindCreativeObjectsWithTag events can find the spawned volume, but none of the listenable events fire at all (this was not a problem for the vfx powerup device.

So that brings me here, wondering what the best way to go about spawning a prop (or some other thing) that can listen for when a player overlaps it and run some arbitrary code when that happens. So far the only options I can think of are:

  1. Just have a bunch of already placed devices hidden in the level somewhere, then teleport them to locations to imitate them being spawned in (not ideal as I’d like to change the amount spawned throughout the game)
  2. Create some function that runs every tick to check whether the player transform overlaps some area. This seems problematic for performance when many powerups are spawned or when the player is moving fast (they can be in a vehicle so it is certainly plausible that they’d move quickly).

Thanks!

Your 2nd solution seems okay, index your spawned props in a grid for better perf so that you don’t check the distance between all pickups everytime and add a bit of movement prediction if you have vehicles :person_shrugging:

1 Like

Hey, thanks for the reply! I ended up going with option 1 as there were so many cases where I wanted to edit the default settings of a device. I do suppose I could have just used VFX devices and tried to re-implement a bunch of device behavior in verse but I just don’t have time to do all that + deal with the jank way that UEFN handles spawning devices currently. Maybe on another project where I have more time and can sit and really hone my verse skills (more maybe if/when SceneGraph allows for device spawning or some other capability that I can leverage).

1 Like