How to select area by mouse to spawn objects in it\?

Hello. I’m working at software implementation of construction of the classroom (including building of floor, walls, windows and etc). I have a problem with spawning floor. I want to select area by mouse and during selecting squares of floor should spawn. but i don’t know how to realize it. Example - this video (Sims like building mode Unreal Engine - YouTube). Thank you for answering!

That isn’t something that UE4 does out of the box, AFAIK. You would have to add that functionality or find a plugin. However, if all you want to do is build a basic model of the room you can try something like this https://www.youtube.com/watch?v=wMRr8q6SHGk. It’s at least a good place to get familiar with UE4 while doing something towards your goal.

Good luck,

You can use spline for this. In the construction script get coordinates of points, calculate distance/Xoffset/Yoffset and create your instanced meshes.

Good luck!)

Thanks for answering!! i’ll try it :3 the one question is about spawning. in which way i should spawn object and how i can calculate the coordinates where i should spawn it (sry. i never used splines)

This is completely another question and it’s not connected with splines at all)

Find a few guides, but better try some options by yourself. Start with spawning 1 cube at different locations, after that try to spawn a little bit more using loop logic and so on.

Good luck bro)

How to spawn object i of course know(I spawning objects not in building mode by line trace). question is about how to connect spawning objects with spline) Sorry for annoying questions

Don’t I even show you the code??

It sounds like there is a lot you should understand before you start worrying about splines. That’s why I suggested you try a different way of building the room – one that doesn’t involve building your own modeling tool first. If the video I suggested isn’t good enough there are others out there as well. I really suggest that you start there and work your way up to more advanced methods.

Correctly so, . I’m new in UE4, and a haven’t got enough time to learn it step by step, it’s my exam work in college. I need to built classroom in real time, not in editor. Although thanks for answering!

Ok, in that case you could see some tutorials about voxel games, but I guess you don’t have much time because they are very long and mostly useless.

After you get your distance between two spline points, you divide each axis by size of your floor piece. Multiply this in the double loop by index and spawn floor piece with a result)

And a little lifehack) Do not take work which you don’t wanna learn.

This project seems a bit unfair to ask of someone just coming to UE4. A real time construction system is an advanced feature even in AAA games. Maybe it would be easier to start with a procedural building tutorial then add the real time construction functionality after you get a little more comfortable. It’s strange because if a class project requires you to get all the answers from a help forum then what good is the class? In any case, good luck, Lefteyetakes.