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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How do i disable a script ontriggerenter? C#

Discussion in 'Scripting' started by amichael, Nov 25, 2015.

  1. amichael

    amichael

    Joined:
    Mar 4, 2015
    Posts:
    48
    Im tying to disable a point trigger if the player collides with an object. I have it set right now as the point trigger gives the player x amount of points, but i want to disable that trigger if the player runs into a obstacle. Is there a way to do this?
     
  2. Elmdran

    Elmdran

    Joined:
    Oct 28, 2014
    Posts:
    34
    Code (CSharp):
    1. collider.isTrigger = false;