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 to make Raycast recognize my script

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

  1. Gousenfire

    Gousenfire

    Joined:
    Feb 18, 2014
    Posts:
    30
    Hello World,
    I want to make my own collider, and I want the Raycast to recognize this collider. And i want to know if I do this collider I can put together with another one? TY guys!
     
  2. relic1882

    relic1882

    Joined:
    Mar 11, 2015
    Posts:
    45
    What are you trying to accomplish? You can put multiple colliders on an object. Do you want to use multiple colliders but only have the one detect the Raycast and not the others? If that's the case, you can put the other colliders on child objects of your game object and set the layer to "Ignore Raycast". I actually learned about doing this recently.
     
  3. Gousenfire

    Gousenfire

    Joined:
    Feb 18, 2014
    Posts:
    30
    ooo ty for the reply. It was pretty much it that i was trying to do, but i've already made it. In my case I cant put them in the layer "Ignore Raycast" because I will use those colliders to check another Raycast. I made it by comparing the colliders. But ty anyway!