how can i generate a random num for my terrain-genreation?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By theMX89

im using this script i wrote:

extends Spatial

func _ready():
	var noise =
	noise.period = 80 <-------------------
	noise.octaves = 6
	var plane_mesh =
	plane_mesh.size = Vector2(400,400)
	plane_mesh.subdivide_depth = 200
	plane_mesh.subdivide_width = 200
	var surface_tool =
	surface_tool.create_from(plane_mesh, 0)
	var array_plane = surface_tool.commit()
	var datatool =
	datatool.create_from_surface(array_plane, 0)
	for i in range(datatool.get_vertex_count()):
		var vertex = datatool.get_vertex(i)
		vertex.y = noise.get_noise_3d(vertex.x, vertex.y, vertex.z) * 60
		datatool.set_vertex(i, vertex)
	for i in range(array_plane.get_surface_count()):
	surface_tool.create_from(array_plane, 0)
	var mesh_instance =
	mesh_instance.mesh = surface_tool.commit()	
func _process(delta):
	$Camera.rotate_y(delta * 0.5)

right at the begining there is the noise.period, whose value i want to replace by an random number, everytime i open the scene. can someone help?

i usually dont speak english, sorry if i spelled something wrong xD

:bust_in_silhouette: Reply From: juppi


here are the Godot Docs for Radom number generation:

In your case you should randomize the seed:

noise.seed = randi()