Search Unity

Raycast Collider Direction

Discussion in 'Editor & General Support' started by Marble, Dec 11, 2006.

  1. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    I just wondered if there was a way for the raycast collider to point in another direction than down. I suppose it's easy enough to use Physics.Raycast, but it would be nice.
     
  2. lurid

    lurid

    Joined:
    Aug 28, 2005
    Posts:
    72
    You can attach it to an empty GO and make that a child of the object you want to the collider on. Then just rotate the empty GO to where you want the raycast collider to point. Its actually a little nicer that way because you can have a rotation to point it and an offset to tweak it all via the standard manipulators.
     
  3. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    Of course!

    I wish I could delete my posts in embarrassment even after someone has posted to them.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Nah, they're instructive because it's pretty much guaranteed that someone else will also have the same question and now they can just search the forums and get an answer. :)

    --Eric
     
  5. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    Maybe I should post all my stupid questions under a pseudonym.