Download

Please help with spawn object

Hi all,

i am finding solution for our project. I have 30 buttons (widget) every button has its own different model to spawn. I want to have only one spawn place on map and always only one object, so if i choose one button from 30 object will spawn on specific place, when i push another button, old object will disappear and new will spawn on same place.

Please if somone could help i will be so so glad.

Thank you so much for every help

This would work OK probably.


I hope you have something better than a wall of 30 button clicks to spawn 30 unique actors, though.

2 Likes

Thanks man, it was just a describtion of problem, yes it will be good i hope :slight_smile: this work, u are amazing thank you for your help

Hi, it i use this setup for spawn BP its working but its not destroyed after i used another button. Is it right also for spawn BP or there is another aproach to use it to spawn more actors and destroy them after load new under another button?

Thank you.

C.

its not destroyed after i used another button.

You’d need to demonstrate how you’re doing it. Provide as much details as you can.

Is it right also for spawn BP or there is another aproach to use it to spawn more actors and destroy them after load new under another button?

Add them to an array as they’re spawned. Another button can loop through that array and destroy them. As in:

Spawn a bunch of actors with a button, and destroy them with another.

1 Like

Thank you, i will try, i created a new topic about my problem DestroyActor - replace actor

Thank you so much for help

But i have mony buttons and selection of them is by user so i dont which one they will use to replace old. And every BP has special locaction where is spawned thats why i cant use array i think, am i right?

I don’t understand what you’re making. I don’t know the rules of your game. I don’t know how you pass location data and who spawn whom following which rules…

If you need help with something so specific, ensure you include plenty of detail.

But i have mony buttons and selection of them is by user so i dont which one they will use to replace old.

What does the above even mean? Perhaps describe the gameplay feature from the player’s perspective.

I have menu where user select one of for example 100 buttons, every button spawn 3 different BP - models on tree locacions, lets say location 1, location 2 and location 3. Every button spawn on same location but different models. So all location stay same, only models are changing. For models i used BP because they are spawned with special widget so i cant only call static mesh to appear. Soi i used sequencer to connect spawning of all three BP with models and add DestroyActor, meaning of it its when u select on menu (menu on the wall in VR) another button, old models (BP of them) will disappear and new will load. Another button look same but only spawned models are different. MOdels is represented by BP13639_1,2,3 in this case

So what is not working in the above example? Looks OK at a glance. You need to expand it so it’s more modular?

if u select first time selected button everythink is fine, but if u select next one, old models stay and next apper also so two models in together, i want that if u select next button old setup will be destroyed and only new models will apear. The problem is only in destroying old BPs

Are all those buttons in the same blueprint?

yes for menu has one BP with all menu buttons, for every button i have another 3 BP with models. Its not working even if i use only one BP without sequencer

Sounds a bit like this then:

Each button calls a custom event and you can pipe in the data you need. Actor classes and locations. Before anything is spawned, we destroy actors and clear the array.


This could probably be scripted better depending on the scope and what else needs to be done later on. Hard to tell at this point. And if the editor complains about passing an array of classes:

image

Hope I understood it right!

And if you prefer to keep your method:

But that will need a lot of copy pasting should you wish to expand it. Meh.

So much thanks for help, i will try and let u know.

Thanks

one more question to this BP, everything is set but i cant connect Var 1,2,3 to same Make Array - its always mark only first and next is not compatible. Do you know what is the problem in?

i am sorry the menu is in the widget, maybe this is the problem right? BP is only visulazitation for this widget

Try it like this:

The first actor you connect to a wildcard will decide of the type. And some nodes allow you to change it on the fly:

image

destroy actor problem.PNG
destroy actor problem.PNG1920×872 114 KB

I have still same problem, old BP isnt destroyed. Any idea about this type of code? I will try now the first aproach what u send to me, but it seems to be more complicated for me.

Thanks you