Author Topic: Raycast Hit Triggers ?  (Read 7137 times)

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Raycast Hit Triggers ?
« on: April 02, 2013, 03:57:03 AM »
In McDROID Raycast hit trigger would be bad, how do we change NGUI so it doesn't require that ?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Raycast Hit Triggers ?
« Reply #1 on: April 02, 2013, 04:31:10 AM »
You turn of Raycast Hit Triggers in physics settings and mark all your colliders as not triggers.

You can make a editorscript that runs through your colliders and disables the trigger flag. You may want to modify the standard widgets as well in UICreateWidgetWizard.cs

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Re: Raycast Hit Triggers ?
« Reply #2 on: April 02, 2013, 05:01:35 AM »
This works well. I am sure the impact on physics is minimal (physics needs rigidbody when changing colliders or there is a big hit)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Raycast Hit Triggers ?
« Reply #3 on: April 02, 2013, 05:27:46 AM »
Just make sure that stuff in your GUI layer can't collide with the other layers, so you don't have some of the bugs I had where my character stumbled on the buttons. :D

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Re: Raycast Hit Triggers ?
« Reply #4 on: April 02, 2013, 05:35:54 AM »
Hehe I think I freed one layer for GUI ... all the others are taken.