hi there and good night(if it’s night in your country now), i want to add one small feature in my project, i have three different types of bullets(there is just one example shooting), and i want them to shoot randomly changing each other, how can i do so?
there is a code for that bullet
var bullet = preload("res://scenes/bullet.tscn")
func fire():
var bullet_exemplar = bullet.instantiate()
bullet_exemplar.position = get_global_position()
bullet_exemplar.rotation_degrees = rotation_degrees
bullet_exemplar.apply_impulse(Vector2(bullet_speed, 0),Vector2().rotated(rotation))
get_tree().get_root().call_deferred("add_child", bullet_exemplar)
if Input.is_action_just_pressed("shoot"):
fire()
help me please