BrickColor.Random()

I’ve recently ran into an error which is quite funny.

Trying to run BrickColor.Random() in studio will always bring out the same first result, being “Slime Green” (this is considering that you just opened studio).

This also works for games and for players who first join and data systems that save stuff like “HairColor” as BrickColor.Random()

This recently began happening, you can try it out for yourself by opening studio and typing BrickColor.Random().

On a side note, for anyone who is experiencing this problem as well, an easy solution is replacing all of your BrickColor.Random()'s with BrickColor.new(Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255)))

Edit: It’s not just Slime Green, it’s the same group of colors always as well.

3 Likes

Is .Random() pseudorandom or is it supposed to be true random?

Yeah, apparently random isn’t quite random>
Math.random same across five scripts
I see a reference to Random.new() at the bottom, but nothing after that.

Useful video on pseudorandom vs true random: Pseudorandom generators

Main point of the video:

use math.randomseed to prevent this i believe

1 Like

Thanks for the report! We’ll follow up when there’s any update on the issue.

Most RNGs are actually pseudorandom! In fact, seemingly “truly” random number generators just use the time as a seed (such as rand() in C). True random number generators are a bit more tricky to implement and typically require specialized hardware.

1 Like

yeah, by true random i meant using the time in milliseconds as the seed.
and by pseudo i meant 1 seed (pre-set)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Hi everyone, this issue has been fixed! :partying_face:

If there are any more issues please let us know.

2 Likes