x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Check if actor exists at location

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 !

Product Version: UE 4.18
Tags:
more ▼

asked Dec 14 '17 at 03:36 PM in Blueprint Scripting

avatar image

Teapot Creation
160 21 32 46

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Well, I finally found something working :
I had to cast to my preview actor and get the root component, and check this component for overlapping with any already placed actor. I really don't know why other methods didn't work, casting didn't help with other overlap nodes.

check overlap

capture.png (164.6 kB)
more ▼

answered Dec 14 '17 at 04:26 PM

avatar image

Teapot Creation
160 21 32 46

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Can you use this?

alt text

pic1.png (162.3 kB)
more ▼

answered Dec 14 '17 at 05:03 PM

avatar image

Master Gebjeter
138 5 8 13

avatar image Teapot Creation Dec 15 '17 at 10:34 AM

Actually I tried a vector==vector node, which didn't work. I didn't try your solution however, but I think it wouldn't work better. The main problem I have is that I have to check this location for each actor of the "placed actors" array, but for only the Preview Actor attached to the mouse.
Well, for now it works well with the Overlap checking. Thanks !

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question