Im trying to make a game where a zombie goes to a random y coordinate but when i run they keep going ot the same spot evn if i use randomize().
Heres the code:
extends KinematicBody2D
func random():
randomize()
return randi()%301
var velocity = Vector2(0, random())
var speed = 200
func process(delta):
var rand = random()
var angle = getangleto(Vector2(300, rand))
velocity.x = cos(angle)
velocity.y = sin(angle)
globalposition += velocity * speed * delta