Attention | Topic was automatically imported from the old Question2Answer platform. | |
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)))
Attention | Topic was automatically imported from the old Question2Answer platform. | |
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)))
Reply From: | stalker2106 |
Vector2 expects two arguments, x
and y
, and you’re only providing one, because randrange()
function returns a single argument.
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))