Download

Preview Actor position before spawning it, help!

Hello everyone,

i posted the same question on answers the other day and got no answer so here it goes again.

I would like to make a building system where by pressing a key i get to see the Actor i want to place and than press the same key again to confirm and properly spawning it. Something like in strategy games or games where you can build stuff.

At the moment i have a very simple line trace that gives me a location where i can instantly spawn my acor, but i would like to preview it first.

I can’t seem to figure out the logic behind something like this.
Any engine function i can look into or tip to get me started in the right direction?

You could spawn a dummy actor or even spawn the real actor with a dummy/preview setting. You would then make the dummy move to where you are looking.

that’s what i’ve been trying to do, what i don’t know is how can i move the dummy after i spawn it.

Why not just parent it to your character, about 200 units in front of it, change the opacity to 50% (so it’s like a ghost) and then have an event listener for your second left click that unparents the actor and places it at the world position it was at when you clicked? That’s how I’ve done it from a first-person perspective. RTS would be even easier I think.