# Triggers, Blocks

There are different types of triggers players can interact with.

* **items\_loot\_trigger** - opens loot window with items inside
* **money\_loot\_trigger** - adds money to player and show message on the screen at left side
* **usable\_trigger** - adds event key to the player (in editor you create your string id for it and inside **p\_game.gd** you give this event description inside **on\_event\_key\_add** function)

And non-interactable triggers such as block! Blocks just block raycast from camera to prevent player interact with objects through the walls of rooms etc.

Let's place money\_loot\_trigger.tscn on the scene and set money value to 100.

&#x20;

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FxxkmlorkIuuPK6vJ0CYR%2Fimage.png?alt=media&#x26;token=a92cc80d-2b31-4855-982e-775a80e24193" alt=""><figcaption><p>Placing money_loot_trigger.tscn</p></figcaption></figure>

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FJsP2OeqIkd3x2PJZpIMK%2Fimage.png?alt=media&#x26;token=237e02ae-4dc4-46b4-9115-17ccd648a488" alt=""><figcaption><p>Set value to 100 in inspector inside Keys variable</p></figcaption></figure>

Then let's place block between spawn point and money trigger. Go to ZONES/ folder and place block.tscn prefab on the scene.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FaPJuh8vhUZXMLaHoy2xY%2Fimage.png?alt=media&#x26;token=b35d520b-892b-41f6-9388-3a9a3fc05ffc" alt=""><figcaption></figcaption></figure>

Set scale as you want. Now if we play this level - we can't use money trigger. You can see colliders, small box is our money trigger.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2F1066YluqOoG2o8gaStCk%2Fimage.png?alt=media&#x26;token=2d4bd8b7-9289-4a30-9c48-f8349bb80d25" alt=""><figcaption><p>Debug colliders</p></figcaption></figure>

Delete block by selecting it inside node tree and clicking RMB and selecting Delete Node (s). Or Delete button on keyboard.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FtEGX1yEl4u0WIu5RAfMg%2Fimage.png?alt=media&#x26;token=6b1c8dad-3311-4f66-ad8e-025c30b2952c" alt=""><figcaption><p>Deleting node</p></figcaption></figure>

Save level and try again to hover the crosshair on the money trigger.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FftQxZp09L57aQmXjTO4S%2Fimage.png?alt=media&#x26;token=4b30b5b5-307f-4d06-81ce-b6b7ede4f294" alt=""><figcaption></figcaption></figure>

Now we can use this trigger and get our money.
