- Home /
The question is answered, right answer was accepted
SetActive not working.
I am learning Unity3d from tutorial projects on unity site. http://unity3d.com/learn/tutorials/projects/roll-a-ball/collecting-and-counting
but my SetActive(false) method is not working by using c sharp. when player gameobject collide with pickups it go inside from them like transparent object and nothing happened they are still in the game scene.
My code:
void onTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Pickup")
{
other.gameObject.SetActive(false);
}
}
any help...
Answer by meat5000 · Jun 24, 2014 at 11:32 AM
Capital O for OnTriggerEnter
Functions and Types begin with a capital, variables start with lowercase, such is convention.
cool... Thanks :) one last question why didn't it gave me error then?
You essentially created your own function. When you create a function using a lowercase it works just fine. Its convention, so all pre-made functions start with a Capital letter.
Follow this Question
Related Questions
Can static objects be enabled/disabled? 1 Answer
Program control not entering onTriggerEnter() 1 Answer
How to set a Collider of a GameObject to Inactive similar to the SetActiveMethod 1 Answer
Not able to set explosion.SetActive(true) on player destroy 1 Answer
enable collider when gameobject false 0 Answers