- Home /
Question by
connorwforman · Jul 13, 2017 at 11:18 PM ·
scripting problemunityeditor
Crate not disappearing...
So I am watching a tutorial by Jimmy Vegas, and I am on the ammo pickup video. When I walk into the crate, my ammo increases, but the crate doesn't hide, allowing form unlimited ammo. Also, if possible, can someone help me set a max ammo carry of 30? Can someone please help? (script)
function OnTriggerEnter (col : Collider) {
GlobalAmmo.CurrentAmmo += 10;
this.GameObject.SetActive(false);
}
Comment
Answer by Cornelis-de-Jager · Jul 13, 2017 at 11:52 PM
Replace this:
this.GameObject.SetActive(false);
with this:
this.gameObject.SetActive(false);
Notice the capitalization
Your answer
Follow this Question
Related Questions
Polymorphism for decisions in a dialogue editor 1 Answer
How to make these scripts work together? 0 Answers
Unity - Cut a sprite in 2 halfs using the form of another sprite 0 Answers
When pressing the space bar, the Unity editor detects it as the "O" key, how can I solve this? 2 Answers
Video Player shows last frame at which it was stopped 0 Answers