Actor not spawning at mouse location

Hi, I was trying to spawn an actor on LMB at cursor location, however, the objects spawns only in the middle of the screen.

Here’s my blueprint.

Where is the mistake?

Thanks for help in advance.

Try this:

(Just add your array in of course)

Also with Shotty’s setup, if you change it to be dividing Y/Y on the break vectors, they will be on the Z-X axis innstead of X-Y. Or divide X/X, to have it on the Z-Y axis. The 3rd value you will have to set yourself, like shotty says.

My first example will only work if you have a position to collide with under your cursor.

Yeah, wall, or any actor that has collision, collision that is set to BlockAll.

I tried, nothing spawns. :C

getting mouse location to world space does not work. And there is some math you have to do to get it into the right spot. There is also no Z location of a mouse click and you will have to get that another way.

The reason why there is no Z is because it is a 2d project.

What kind of math?

I will look where I did it and put up a snap shot of it. But I’m saying there is no Z period on mouse click whether its 2D or 3D. I have an AI which moves on mouse click and you have to create the Z axis location

here is a screen shot of getting correct X and Y axis with the mouse to world space node.

“Position to collide”, you mean something like a wall? Did I understand correctly?

Ok, I tried your solution once again and it worked. I’ve put a wall. But the object spawns only once per several seconds, don’t know why.

Thanks Mosel3y, thanks shotty46290, your advice were greatly helpful.

This worked very well, thank you - i was surprised it worked so easily!!