![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | leon4aka |
Hello, how do i get a random with or? I need 90, 180, or 360 not other random values. I tried it like so: “rotation = 90 or 180 or 360”
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | leon4aka |
Hello, how do i get a random with or? I need 90, 180, or 360 not other random values. I tried it like so: “rotation = 90 or 180 or 360”
![]() |
Reply From: | exuin |
Here’s one way:
const ANGLES = [90, 180, 360]
func _ready():
randomize() # You must call this function to randomize the seed
func pick_random_angle():
return ANGLES[randi() % 3]