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 set up a "Ghost" collision sensor?

Discussion in 'Physics' started by DGPhoenix, Mar 30, 2015.

  1. DGPhoenix

    DGPhoenix

    Joined:
    Jan 24, 2015
    Posts:
    3
    I'm making a simple basketball sim, and I want to make a sensor just below the net that will +1 to a variable, so I can make a functional scoreboard. I can't make a solid object, because that would mess with the ball, so the ball needs to be able to pass through unhindered, while the "ghost" object detects a "collision", so I can add points. If anyone could help, I'd really appreciate it.
     
  2. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
  3. modegames

    modegames

    Joined:
    Dec 1, 2014
    Posts:
    36
    Use OnTriggerEnter in order to get the event for when this happens.

    However for your example you might need to put a trigger within the ring and then read the velocity of the ball as it exits the trigger so you know it passed through the ring from top to bottom.
     
  4. DGPhoenix

    DGPhoenix

    Joined:
    Jan 24, 2015
    Posts:
    3
    Thank you so much! That is WAY easier than I expected it to be!