- Home /
Detect if a collider was hit by a raycast
Okay so the skinny of the problem is that I want an object to detect if it is getting hit by a raycast that is being emitted by the player. I am using this for the raycast:
Physics.Raycast(transform.position, transform.forward, 100, mask.value)
Essentially what I want to achieve is that the player will look at a square and activate that specific square. Because of this I need a way to detect the raycast and using SendMessage would not work since that'd activate every block.
Comment