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"

How Can I Make Walls Automatically Connect?

I made a wall that the player can place on the ground. The wall should be a post when it is alone and when other walls are placed next to it, the walls will automatically connect. how can I do this?

Product Version: UE 4.18
more ▼

asked Feb 09 '18 at 12:59 AM in Using UE4

avatar image

1 1 2 2

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

1 answer: sort voted first

There are a number of ways that you can do this.

I made a similar system for a game jam where when you place two fence posts one grid tile apart from each other, the wiring for the fence would automatically connect them. Basically you have a placeable post actor that, when spawned (when you place it on the grid point) it fires a trace along the X and Y axes, and if the trace returns a hit with a component match (comparing against your wall post) it should spawn a wall there.

You can then set up the wall piece to expand outward based on its x or y scale if you set up its origin point and forward rotation correctly, so based on where you return a hit, i.e. on the positive/negative x/y axis, you would rotate your wall mesh to face the right direction, and then scale it along its forward axis to fill the gap, depending on what grid size you'd like to use.

Here is a video showing it in action, please let me know if you have questions, I may be able to extract the build code for this for you to review if necessary.


more ▼

answered Feb 09 '18 at 05:11 PM

avatar image

128 6 5 11

(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