so I'm creating a game that basically displays a customer, and the texture of the customer randomises every time the 'next costumer' button is pressed, i want to make it so that every time the 'next customer' button is pressed it randomises an integer between 1 and 10 and if the number is more than 1 then the photo of the costumer's ID will match the texture of customer and if the number is equal to 1 then it will display a different photo
my issue is every time i press the 'next customer' button no matter how many times it always seems to be the same photo as the customer's texture and never seems to display the incorrect one
my code so far:
var num = null
dd = ''
mm = ''
yy = ''
num = randi() % (1-10)
#$NXTButton.visible = false
$Booth2D/PassSprite.visible = true
$Person1.visible = true
var texture_id: int = randi() % text_array.size()
var chosen_texture: Texture = text_array [texture_id]
new_text = chosen_texture
$Person1.texture = new_text
if new_text == Elisa and num <= 1:
$Booth2D/PassSprite/PassPhotoSpr.texture = ElisaP
elif new_text == Elisa and num > 1:
$Booth2D/PassSprite/PassPhotoSpr.texture = EricP
could it be to do with the way im randomising the numbers ?