Search Unity

how do I make a block collider turn on and off.

Discussion in 'Getting Started' started by frogfrogfrogfrogfrog, Mar 1, 2019.

  1. frogfrogfrogfrogfrog

    frogfrogfrogfrogfrog

    Joined:
    Nov 19, 2018
    Posts:
    7
    I am making a game and I have a problem. I have made a long red block that looks like a laser, but how do i make it disappear and reappear?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Call gameObject.SetActive(true) or gameObject.SetActive(false) on it.
     
  3. frogfrogfrogfrogfrog

    frogfrogfrogfrogfrog

    Joined:
    Nov 19, 2018
    Posts:
    7
  4. frogfrogfrogfrogfrog

    frogfrogfrogfrogfrog

    Joined:
    Nov 19, 2018
    Posts:
    7
    what do you mean by call gameObject
     
  5. frogfrogfrogfrogfrog

    frogfrogfrogfrogfrog

    Joined:
    Nov 19, 2018
    Posts:
    7
    nevermind I figured it out