228k views
3 votes
"void OnTriggerEnter(Collider other)

{
if (other.gameObject.CompareTag ( ""Pick Up""))
{
other.gameObject.SetActive (false);
count = count + 1;
SetCountText ();
}
}
In the code above, there are two functions, one that returns a value to the user and another that does not. Please identify each."
a) The "SetActive" function returns a value, and the "SetCountText" function does not.
b) Both functions return values to the user.
c) Neither function returns a value to the user.
d) The "SetCountText" function returns a value, and the "SetActive" function does not.

User Dilara
by
7.9k points

1 Answer

3 votes

Final answer:

One function returns a value to the user, while the other does not.

Step-by-step explanation:

In the given code snippet, one function returns a value to the user, while the other does not. The function SetActive() does not return a value. It is used to deactivate the game object represented by other.gameObject. On the other hand, the function SetCountText() does not return a value either. It is called to update the text that displays the count of pickups in the game.

User Jellyfish
by
8.8k points