Announcement

Collapse
No announcement yet.

Instance an actor in every axis.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Instance an actor in every axis.

    Just need to know how to instance an actor in every axis, like in a grid fashion. I have a blueprint set up right now but it only duplicates in one direction, I need it in all directions. I think I have to make an array but I'm not sure how to go about doing that. Any help would be greatly appreciated.

    Click image for larger version

Name:	instance.JPG
Views:	1
Size:	111.0 KB
ID:	1220367
    Last edited by Corweee; 05-16-2017, 03:03 PM.

    #2
    An array would work if you don't need it to rotate.

    Comment


      #3
      [MENTION=700318]Corweee[/MENTION]

      Do you want it to look like a cross or do you want to have instances all around a certain objects going outwards, like a tile generator?

      With cross I mean this:

      Main channel:
      https://www.youtube.com/channel/UCGC...o9s3YcA/videos

      Comment


        #4
        I might get to bed soon, so I made the two variations to not let you down.

        Cross method:
        Click image for larger version

Name:	2e7fa80fcce043128d43a6aed24f88b6.png
Views:	1
Size:	572.7 KB
ID:	1128167


        Variables used:

        Distance = 50
        MaxInstancesLoops = 20

        Note: Make sure to click the "eye" icon on the variables to expose them to the scene you are working with. It makes it far easier to fine tune the parameters that way.

        Grid method:

        Part 1:
        Click image for larger version

Name:	729000a6495443498cda4d9b7bbccbc6.png
Views:	1
Size:	364.9 KB
ID:	1128166

        Part 2: (same graph). Note: The "Set Distance Row" from part 1 is connected to the "For loop" on part 2.
        Click image for larger version

Name:	711e0617235243828b74bb211b659661.png
Views:	1
Size:	428.8 KB
ID:	1128165

        Variables used:

        Rows = 20
        Columns = 20
        DistanceRows = 50
        DistanceColumn = 10
        InstanceSwitcher = 0
        Offset = 50

        Note: Make sure to click the "eye" icon on the variables to expose them to the scene you are working with. It makes it far easier to fine tune the parameters that way.

        Hope I could be of help .
        Last edited by DarkGodsLair; 05-16-2017, 10:03 PM. Reason: somehow I doubleposted. Broke the images. Now fixed.
        Main channel:
        https://www.youtube.com/channel/UCGC...o9s3YcA/videos

        Comment


          #5
          Okay, I think I've figured out what you're trying to do. You need a nested for loop, to create your instances in two dimensions.

          Blueprint:



          Result:

          Comment


            #6
            Yup! Nested loop was exactly what I needed, my programming friend helped me earlier with it but this is great, thanks for the replies guys!

            Comment


              #7
              Also, there is a 2dGridExecutionMacro node that does all that and more. As seen here:

              https://forums.unrealengine.com/show...l=1#post686895

              The rest of the code is responsible for checker pattern and can be ignored.

              Comment

              Working...
              X