mercredi 21 décembre 2022

How to instantiate a randomly picked ScriptableObject?

Im new to Unity and c#, I've been making a turn based game following one of Brackeys tutorial and i've added scriptable objects to it. Im looking to instantiate a random enemy everytime a fight starts.

Here's the lines that should be useful : ImageOfMyCode The resources.LoadAll("Enemies") seems to work since I made 3 scriptable objects and the debug log also says 3.

Im really struggling past this to then shuffle allEnemies and instantite the randomly picked one.

Any help and guidance will be appreciated.




Aucun commentaire:

Enregistrer un commentaire