Announcement

Collapse
No announcement yet.

Getting Random Floats on a bunch of Vectors at once

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

    Getting Random Floats on a bunch of Vectors at once

    I'm an absolute newb. Please, for the love of all that is holy, tell me there is an easier and more practical way to do things like this. Like, a RandomFloatInRange that produces a new number for each pin or something. Halp plx. O_O


    The horror. The horror.
    Last edited by Bluntie; 02-19-2016, 08:52 PM.

    #2
    Loops are your friend my man :P

    Using a standard for loop, you can even generate an array of any size.

    If you want to go a step further, macros and/or functions with inputs and outputs engineered to your needs could generate some interesting custom nodes for your code.

    For example, you can have a boolean input in your getRandomVector macro that allows you to generate the mirror of a vector along a plane that you designate. Useful for making symmetrical shapes with youe vector generating machine.

    Id provide a code example, but im at school typing from my mobile xD
    Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

    Comment


      #3
      That does sound like the way to go. Right, it goes on The List. A List that is getting fairly long these days... Thanks, man, I shall read up and attempt!

      Comment


        #4
        Never fear! Macros are ez pz. You can just select all the relevant nodes (in your case the x and y random float in range stuff, and the make vector node i guess), right click, and select the create macro option.

        Then just nest that inside a loop and youre done!

        Macros and functions can be as simple or as complex as you need them to be. You just gotta do a bit of planning of what inputs and outputs you need to most efficiently and flexibly produce the output you need.
        Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

        Comment

        Working...
        X