UMG > BP Spawn

Hi,

I have a BP Switch placed in the level that opens a UMG (with 3 buttons, A, B, C) to spawn a BP Building (A, B, C Building). I have several of these BP Switches around the level. When I press the UMG button, it calls spawn (buildingtypeA B or C) from the game instance.

But my issue is that it is spawning the selected building at all Switch locations, rather than just the one that I am interacting with.

Is there a way to spawn the BP building of choice just at that instance?

Basically I have an RTS-style interface where I want to spawn specific buildings at specific locations.

Am I overthinking this? :joy:

Can you post the BP/code you have so far?

  1. Interact with switch opens the UMG
  2. Clicking ‘Farm’ Button calls event
  3. Spawns actor(s).

Video of the sequence.

Where is the “Cube 1” Component Actually located? Its possible the build function is firing to each Actor that contains it, resulting in buildings at every location. If that’s the case, you’ll have to give them specific identifiers/associations and check them.

Cube 1 is in the Spawner BP, so it is spawning for all instances. What I would like to do is spawn it per instance when I select from the UMG.

For example, I want to be able to spawn different building types.

So your current UMG Widget is effectively calling the Build function on all instances of the spawner at once, resulting in the same building being spawned at every Spawner’s “Cube 1” Component transform at the same time.

You’ll have to add some sort of method of identification like this. Add an Instance Editable Int Variable that you can change from the outliner after placing the Spawner BP, then from the UMG Widget, Check for that specific Spawner’s ID and get that Spawner’s Cube1 Component Transform.