Download

Overlap Issue with Simple Build System

Hey Everyone

I am trying to implement a simple build system. So basically, when I press ‘TAB’ it brings up a Transparent Box I can move around, and provided it hits something, I can then press ‘Left Mouse Button’ and it will spawn an actor at that location.

My problem, is it seems to be able to overlap with other objects until it reaches about the middle then goes on top of that object.

What I wanted to do, is have it avoid overlapping all together. You can see below in pictures. I don’t mind being able to place ontop of another object, I just don’t want it to overlap. Is anyone able to perhaps point me in the right direction that I should be looking at. My line trace code for moving the object around is below.


Thanks Everyone

So I have an idea more then a straight up solution.

when you hit tab spawn the same instance model you would be able to place with a different material (transparent).

move this model around and make use of the overlap start/overlap end events to keep track of what its interacting with.

if it interacts with nothing you can assume it’s good to be placed. if it interacts with something you can actually just re-adjust and essentially snap into location.

This way you can also give every actor or mesh you spawn the correct collision type to interact with one another.

Say you want to build a wall Ark style for instance - if you have not played it don’t bother, its a worthless bugfest almost worthy of EA - you need to know when placing items if they can interact and snap with one-another.
The easiest way to do that is the custom collision against the “ghost” models.

Hope that helps.

Hey MostHost, thanks for the idea. I will give it a shot and see how it works out. Hopefully it does the job. THanks.

EDIT: Ok, so turns out, that since everything I don’t want it to overlap with are all children of a single Master Item, I was able to use the Node ‘Get Overlapping Actors’ and if it returned an array greater than 0, then I just disabled placement. Nice and Easy. Updated Screenshot Below.