Hi there,
the question sounds simple but I cannot figure out how to make this work properly.
I’ve got a scene where I can place some objects using the mouse. When the object is placed near from another, it kinda snaps to the nearest side of the already placed actor.
However when placing two actors side by side, the system moves the third (future) actor on the first one. Basically, as the second is placed and it’s position is not valid, it goes the nearest place possible, so where the first actor is spawned.
How could I say to the actor that “if there is already an actor there, just hide and don’t spawn it” ? I’ve already tried a BowOverlapping node, SphereOverlapping, IsOverlappingActor, GetOverlappingActors, checked the location to be similar with the spawned location, but it never returns correctly for all spawned meshes.
Here are the details :
A preview actor is spawned at the location of my mouse (top-viewed scene). LMB spawns the actor at location if valid. The new preview actor is at the mouse location again. When the cursor approaches a previously spawned actor, in a certain range, the preview actor is snapped and placed at the nearest side of the placed one (actually at the location of a defined Arrow component, with some offset). This way I can put many objects at regular intervals.
Now, if I point at an already placed actor, the preview mesh is snapped at a side, but if there is already an actor placed there, it doesn’t care about. That’s bad
How to do this ?
Thanks !