I am trying to make my ball in pong go in a random direction when I start the game, but for some reazon everytime I try it goes in only one direction.
My code looks like this:
var random_dir = randi() % 100 + 5
var up_down = randi() % 10
func _ready():
randomize()
if up_down >= 5:
random_dir *= -1
else:
random_dir`
For some reason the ball is always going down. I'm sure I am missing something important but I can't figure out what.