Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Need Scripting Help please

Discussion in 'Scripting' started by Bigfoottheape, May 5, 2016.

  1. Bigfoottheape

    Bigfoottheape

    Joined:
    Feb 21, 2016
    Posts:
    3
    I am an ameuter at coding but I am currently doing a school assignment and I need some help on the game I am making.

    How it goes is when an object's collider (In my case a Key), is triggered, another object is scaled to 0. Practically making it disappear. How would I do that in code. (I have tried many ways and nothing is working) Anything will help, thanks
     
  2. Rob21894

    Rob21894

    Joined:
    Nov 21, 2013
    Posts:
    309
    Instead of scaling it to 0, you can use

    Code (CSharp):
    1. gameObject.SetActive(false);
    this will make it disappear in the scene.
     
  3. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
  4. Bigfoottheape

    Bigfoottheape

    Joined:
    Feb 21, 2016
    Posts:
    3
    Ok Thanks Heaps