ningún constructor de Vector2 coincide con la firma Vector2(float)

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

no constructor of Vector2 matches the signature Vector2(float)

R.set_linear_velocity(Vector2(rand_range(R.velocidad_min, R.velocidad_max)))

:bust_in_silhouette: Reply From: stalker2106

Vector2 expects two arguments, x and y, and you’re only providing one, because randrange() function returns a single argument.

:bust_in_silhouette: Reply From: cinammon_coder

Tienes que agregar la variable y, siendo 0, y tu codigo resultaría así:

R.set_linear_velocity(Vector2(randrange(R.velocidadmin, R.velocidad_max), 0))