Random float in str

Hello. Can i create a random float in a structure, so that after taking it outta the structure it will give a random value in its ranges?

Hey @Username0520!

Can you elaborate a little further? You want to get two random numbers and then get a random number between the two?

I want to create a variable which would have a range of floats with two of them, and after calling it, the variable would return one float between them.

Sounds like this:

You can add the Vector 2D to another struct.

1 Like

You absolutely can do that!
First, make your struct, 2 floats.
Then you make a variable for the float on your BP. After that you can set each (say min float/max float). After this, you can use “Random Float In Range”, and plug the min/max variables from your struct into this, and it’ll return a number between the two! Use “Truncate” on that afterwards if you want an integer.

Edit: @Everynone We posted like right at the same time. Didn’t think about using a vector, there’s no reason you couldn’t do that!

2 Likes