Hey guys,
So this script below works closely with another Timer script. The goal of this game is that every 15 seconds… The goal of the level will change randomly for example:
@1M 15s:
Collect multiples of 3
@1M :
Collect multiples of 4
etc…
So the player is basically catching falling apples with numbers on them…
And to detect what multiples we are looking for I’ve used variables such as lookingformultiple 3 = true when timer <= 75s and >60s.
Now the code below that is commented out is working perfectly as desired! ![]()
So now I’m working on if the player collides with an apple with a value of 4 and it meet this condition or this condition… DO THIS.
When I uncomment all the code and let it run through it’s entirety… I don’t get the expected output…
The player collides with apple 1 when “Collect multiple of 2’s” is active, this is the output:

As you can see the 1st output is correct but I don’t see where it’s getting the 2nd output from.
C# Script Below:
void OnTriggerEnter(Collider other)
{
/*if (other.gameObject.tag == "apple1")
{
Debug.Log("Apple 1 Wrong");
}
if (other.gameObject.tag == "apple2" && TimerManager2.multiple2 == true)
{
//ismultiple2 = true;
//add points to slider
//play success sound
//ss.AddPoints();
//SliderScript.AddPoints();
Debug.Log("Apple 2 Right");
}
else if(other.gameObject.tag == "apple2" && TimerManager2.multiple2 != true)
{
Debug.Log("Apple 2 Wrong");
//remove points from the slider
//play error sound
}
if (other.gameObject.tag == "apple3" && TimerManager2.multiple3 == true)
{
Debug.Log("Apple 3 Right");
}
else if(other.gameObject.tag == "apple3" && TimerManager2.multiple3 != true)
{
Debug.Log("Apple 3 Wrong");
}*/
if (other.gameObject.tag == "apple4" && TimerManager2.multiple2 == true || TimerManager2.multiple4 == true)
{
Debug.Log("Apple 4 Right");
}
else if (other.gameObject.tag == "apple4" && TimerManager2.multiple2 != true || TimerManager2.multiple4 != true)
{
Debug.Log("Apple 4 Wrong");
}
}
}