Probability (number from 0 to 100) is actually more like a weight, how likely is it to choose this pool when we pick a random one.Each element is a pool, which also have some properties. A size 0 is an empty list, a size of 2 has 2 elements. It has a couple properties too, let's look at those. Pool List (list of pools) is, as its name implies, a list of the possible pools this spawner can choose to spawn a random something.Fan out (checkbox) tells the spawner if it should spread out the items on spawn.Loot count (number) is the amount of items this spawner should spawn.If you go to the bottom of the component list, you will find the RandomItemSpot component. Left click on the RandomTool and take a look at the inspector view. Navigate to the folder where the Random Spawn Spots are, at the time of writing this guide that is Assets/Resources/Prefabs/Items/Spawners This is just a data holder, but it is important because it has all the possible items this pool can spawn and their probabilities, among other cool stuff we will inspect later.Īlright, so how do we get started? Let's take a look at a spawner that has already been done before we make our own. Random Item Pool (name subject to change): is a Scriptable object that contains a list of values.Simply drag it from the project view to the desired location in the scene view. You will use this object to define a position in your map to spawn something when the game is running. Random Spawn Spot (name subject to change): is a Prefab that contains all the logic to spawn random stuff at its position.The Random spawner system, spawn loot or however you want to call it uses two critical elements to make it work: Ok, so you want to include some surprise mechanics in your map? Wonderful, but first let's define a couple concepts so we're all in tune and you can understand this guide. Undo RecordObject vs EditorUtility SetDirty SyncVar Best Practices for Easy Networking
0 Comments
Leave a Reply. |