I find myself generating random numbers all over my code. It’s super easy to just create a RandomNumberGenerator instance whenever I need one. This seems wasteful, yet the Godot devs seemingly designed it this way on purpose? Should I just have one RNG object on my global class? Or do those instances use very little memory and am I overthinking this? Thanks for any advice!
You don’t need to create a RandomNumberGenerator every time, just use the global scope functions randf_range, randf, randi_range and randi_range. Or create an autoload and access your RandomNumberGenerator from there.
Or do those instances use very little memory and am I overthinking this? Thanks for any advice!
Unless you’re creating hundreds of that, you’re overthinking.