vendredi 1 janvier 2021

Can I use self.math.random on 2 Npcs?

I have this script on 2 npcs but both choose the same random number (7) how do I make the Npcs choose their own number? I did try with self.math.random and it gave an error so what would the solution be? will I have to create different variables for each npc related to the random function?

function Behavior:Awake()
    math.randomseed (os.time())
self.destino = math.random( 1, 7 )

In the engine I work with it says to put self. for independence...




Aucun commentaire:

Enregistrer un commentaire