Randomising Item Drops

An introduction to using Arrays in Unity

Prelude

Right before destroying the Object we Instantiate an Item Drop.
For each ID we have a bracket of code.

Array

Use Example: Find GameObjects with Tag

Retrieving data from the Array

Retrieve element by index number
Array.Length

Randomising the Index

Conclusion

Software Engineer — Unity Game and Application Developer