Hello everybody
using javascript
I have a raycast script which instantiates effects on the object that the ray hits based on the tag on that object.
private var rayhit : RayCastHit;
if(rayhit.collider.tag == “Wood”)
{
do stuff ;
}
Is there a way I can replace the tag detection with physics material detection, so that I can have a few physics material for each for a type of surface that I need and when the raycast hits them it would instantiate the appropriate effect instead on using tags?