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"

Align two mesh in game

Is possible to align two mesh by face? For example from this

alt text

To this

alt text

Product Version: UE 4.9
Tags:
more ▼

asked Nov 08 '15 at 10:24 AM in Blueprint Scripting

avatar image

Komahz
199 11 14 21

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Sure its possible but how do you want it to done? Are they going to stick to each others? Are they working as magnets? Please explain a little what you trying to do. In general you can try this:Block A and Block B first you rotate the block B to the same rotation as block A using Rinterp ,then you make a vector with rotation from Block A with the width of the block, that way you have the position where the block B need to go, then you just use custom build function to move the block B to position. Ps: The custom function should be used with rinterp in tickevent, it will be really useful if you used distance between the blocks in Rinterp, the closer they are the faster the rotation. Pss: These will work only for one side if you want it to work for the others as well you need to check where block B is located and getting a different rotator for the vector with rotation. If you want them to just teleport you just need the rotation and the vector and that it.

more ▼

answered Nov 08 '15 at 12:17 PM

avatar image

DDemon
473 21 10 25

avatar image Komahz Nov 08 '15 at 12:33 PM

Sorry, infact my question is too poor for some help. What i'm trying to do is a minecraft style building. Currently i have a line trace from my camera that when it will hit i should be able to place one actor aligned to the hit actor

avatar image DDemon Nov 08 '15 at 01:02 PM

Lol what you trying to do is really simple, I use simple grid system, lets say each height and width for your blocks is 100, all you need is the hit location. From the hit location set it to grid location and then back to location that way it will reset to perfect grid location example: hitlocation- X=123 Y=143 z=0 end result will be X=100 Y=100 Z=0 and set the location of your new block as that. Ps: all blocks should follow the grid system if not it will be a mess.

avatar image Komahz Nov 08 '15 at 01:06 PM

I can't because the first block is not "snapped" to a grid

avatar image DDemon Nov 08 '15 at 01:15 PM

Then make it snap, if not you trying to create something a lot different than minecraft style, and you need to take the rotation of the first block then get the vector from the block to the right position with the rotate vector and the width of the block and just spawn or teleport the second block to position with the rotation of the first block.

(comments are locked)
10|2000 characters needed characters left
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