I am very new to Godot and generally making games but I have this tiny problem.
I am making an Asteroids type game and the basics of it are. I destroy an Asteroid and it splits into multiple smaller versions with random vectors.
This works perfectly fine until I try to run it in a browser. In the browser, the vectors for each separate instance are exactly the same every single time.
Here is my code for spawning them
var ma = med_asteroid.instance()
var ma2 = med_asteroid.instance()
Here is the spawn code
var rng = RandomNumberGenerator.new()
position = pos
rotation = rng.randf_range(PI,-PI)
speed = rng.randi_range(ba_speed_min, ba_speed_max)
velocity = Vector2(speed, 0).rotated(rotation)