0

I made a trail in my program, which I would like to be clickable, like a button. I thought about adding a collider, and hitting it with a raycast, but it forces me to exempt it from various OnCollision triggers (it's not meant to affect them at all). How can I handle it efficiently?

31eee384
  • 2,748
  • 2
  • 18
  • 27
Raledon
  • 3
  • 2

1 Answers1

0

You can use Unity's concept of physics layers to solve this problem. You can choose which layers interact with other layers, and pass the layer as a parameter to Raycast to restrict to the layers you want to check against.

31eee384
  • 2,748
  • 2
  • 18
  • 27