# SETUP GUIDE

### Animation Event and Event Receiver

There are animation events already set up as `On Footstep` and `On Attack` at the monster’s animation files.

At the `Animator` object inside a monster prefab, there is a `Animation Event Receiver` script attached to it, which will receive these events and can be used to trigger some functions when the event is fired.

For example, in the `PF Skeleton – Archer` prefab, the `On Attack` event is used to trigger the `Launch` function of the `Projectile Launcher` script, so the archer skeleton can actually shoot an arrow.

![](https://442324319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmSx8trfX3J4tI1Wvg8rF%2Fuploads%2FHnsxiSWa9YHFibPNvarU%2F0.png?alt=media)

### About Monster Prefabs

For every kind of monster, there is only one original prefab, and the skin variations are set up as prefab variant of that original prefab.

### Custom Sort Axis

It is recommended that you set `Transparency Sort Mode` to `Custom Axis` and `Transparency Sort Axis` to `[0,0,1]` at the graphics settings.

![](https://442324319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmSx8trfX3J4tI1Wvg8rF%2Fuploads%2FIn2nY0U3xG7LnKZ7t9CJ%2F1.png?alt=media)

### Sorting Order Glitch with Multiple Monster

You may see some glitch when two monsters are too close. It happens when the two monsters take up the same z space. Give them different z position value will solve the problem.

You can set the monster’s z scale to a smaller value like 0.1 (but avoid setting it to 0), so that it takes up less z space.

![When the two monster are too close, and their position.z values are all at \[0.0\]. You can see their sprites got mixed together](https://442324319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmSx8trfX3J4tI1Wvg8rF%2Fuploads%2F7hEtEomlqZykkxAYviXI%2F2.png?alt=media) ![Give them different position.z values. Displayed in 3D view](https://442324319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmSx8trfX3J4tI1Wvg8rF%2Fuploads%2F726qKJGJ8FUtsZiinlAW%2F3.png?alt=media)

![Now they are properly displayed](https://442324319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmSx8trfX3J4tI1Wvg8rF%2Fuploads%2Fi4wk9dpmcQoxJwWQ96Bv%2F4.png?alt=media)

### Skin Weights

For best animation quality, in `Project Settings/Quality`, `Skin Weights` should be set to at least `2 Bones`.

![](https://442324319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmSx8trfX3J4tI1Wvg8rF%2Fuploads%2FxXgo4BS3kwjU7Iw30Xq6%2F5.png?alt=media)

### Input System in Unity 6.1

For compatiblity, the default input method in this asset still uses the old input manager. And in Unity 6.1, the old input manager is no longer the default option.

If you encounter any error regarding the input system. Please change the `Active Input Handling`  in `Project Settings/Player` to `Both`

<figure><img src="https://442324319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmSx8trfX3J4tI1Wvg8rF%2Fuploads%2Fxc4b2TRVQQMQcFuWxmFi%2FUnity%206.1%20Input%20Handling.png?alt=media&#x26;token=1f04c696-a63b-4b9f-a89d-dd72886f05ee" alt="" width="375"><figcaption></figcaption></figure>
