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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store