How can I have my actors spawn in desired locations?

I have actors like a bed, chair, campfire etc. that I want the player to be able to spawn in the level. Right now I have the preview actor set up so you can see where the location is valid or invalid but the hit actor valid location is set to tag floor. That means even the campfire is going inside the cabin. I want furnishings going on the floor and things for outside like the campfire to go to my landscape tag only. I also have the actors set so you hit tab and then hit the number key assigned to it to choose what actor will be spawned. How do I tell it only certain actors can be spawned on certain tags. I hope I worded this well. I have never asked for help before but then I have never been so stuck and I am new to both Unreal and Blueprint. I added the script I am using if that helps. Thank you for your patience and any help you can give.

Could you perhaps have a custom collision channel called ‘inside’ and have all actors which can’t spawn inside block it. Then have collision volumes in all areas considered inside.

I’ve not worked with specifically what you’re asking before but I can see see this being an expandable way of defining what types of actors can go in certain spaces.

There was a recent topic asking the same thing which I was gonna reference here but I couldn’t find it. Anyways, you can just adjust the spawn location a little bit before plugging the value into the location pin (which you can expose by splitting the transformation pin) of your Spawn AI / Spawn Actor node.

To do this, you can use the “Random Point in Bounding Box” node by inserting the initial spawn location of your actor into it’s “origin” pin and the desired extent into it’s “box extent” pin. Or you can use the “Random Float in Range” and “Make Vector” nodes to make a random vector that’s gonna be added onto the initial spawn location.

If you want to set the spawn locations using a more strict logic, you could put your blueprint code where you handle spawning into a function, add an input pin to your function, and plug in a dynamic variable into there while calling it.

I am sorry, I don’t understand a lot yet. I am coming from Unity and coding in C# to Unreal and blueprints so I feel like a lost soul. I did add an image of what I have so far hoping you can read it and understand better what I am trying to do. Thank you

Thank you, I am so new to this I don’t always understand. I am coming from coding C# in Unity to Unreal and blueprints. I did add an image that I hope you will be able to see and follow to understand what I mean. I do appreciate you.

I think I already did understand you, so my answer is the same :smiley: If I couldn’t though, could you please explain your objective more clearly? Or if I was able to understand your objective but you couldn’t understand my explanation, is it due to the blueprint code? I think my descriptions were pretty clear, you can try following them and if that doesn’t work out, you can send a screenshot of your implementation for me to spot the mistakes :innocent:

I also found some other approaches with visualizations which you might consider implementing:

Thanks for the image. I think I understand what you’re aiming for.

Could you store a string variable in each of your actor types for the Tag it can be spawned on? - then where you have the “Actor Has Tag” node, plug that variable in instead of explicitly entering “Floor”

If a “Landscape” tag is associated with a campfire for example, when the campfire is the active preview actor then the queried tag would be “Landscape” instead of “Floor”. When a Chair is selected it would look for “Floor”. You could take it further and have the tag be “Wall” or “Underwater” etc as you keep going.

Thank you I will try. I think it is more me having trouble adjusting to the blueprint nodes but I have done a bit more studying of the nodes and re read your suggestion and I think I now understand enough to give it a try.

Thank you so much, it sounds like this might work. I am going to try this and the other suggestion that was given and see what happens. It’s all a learning experience and I know one day I will look back and think how could I not have figured this out. I am grateful for kind people willing to help on the journey.