# Determine Objects Tests

These settings are located in the **CISCharacterInteraction** component.&#x20;

They determine the rules for selecting an object for interaction if multiple objects meet the conditions for a successful interaction.

<figure><img src="https://103152989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F29yzWK4hGQ2PluXn73VV%2Fuploads%2Fsm79n2jk2mmZ8Jqr58Y3%2Fimage.png?alt=media&#x26;token=d4924e71-afcd-4b07-a27d-01a0a9981ff8" alt=""><figcaption></figcaption></figure>

Example: In front of your player, there are 3 golden apples

<figure><img src="https://103152989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F29yzWK4hGQ2PluXn73VV%2Fuploads%2FqcSU5ck1rCBcN2b1Eg2D%2Fimage.png?alt=media&#x26;token=4900f632-b113-4cba-9d18-f3048b1b35d9" alt=""><figcaption></figcaption></figure>

After you have approached them closer, you want to pick one of them up. However, certain rules must be taken into account.&#x20;

For example, the closest apple to the player should become available for interaction first.&#x20;

To do this, create a new subclass of **CISDetermineUseObjectTest** and override the **CalculateObjectScore** function.

<figure><img src="https://103152989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F29yzWK4hGQ2PluXn73VV%2Fuploads%2FrYNz1ZEbPrzjC8jS2hZt%2Fimage.png?alt=media&#x26;token=8b0bef6f-b2a2-49be-8bb3-93f7fd0ccdf7" alt=""><figcaption></figcaption></figure>

As you can see, here we calculate the distance between the player and the object. Next, we calculate scores based on this distance along a curve and return this value in the Return function.

![](https://103152989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F29yzWK4hGQ2PluXn73VV%2Fuploads%2FVrLM3Gdh4TJoK417IXao%2Fimage.png?alt=media\&token=f4c6b394-9a05-499b-9a02-22845ba9b72c)

What is the result? Now, if you add this test to your character for interaction, the closest object to the character will become available for interaction, rather than some random object.

<figure><img src="https://103152989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F29yzWK4hGQ2PluXn73VV%2Fuploads%2FYfFWM9lt4OLWBdJ0oLOh%2Fimage.png?alt=media&#x26;token=4f6c30df-3002-4e66-9d9b-34d2a7e45514" alt=""><figcaption></figcaption></figure>
