i got 3rd person shooter char, and i want if player ray hit someobjects toward player, player will do some animation.Thanks for view !
You mean something like this :
RaycastHit hit
if(Physics.Raycast(player.transform.position,player.transform.forward,out hit))
{
if(hit.collider.compareTag(‘enemytag’)
{
player.GetComponent().Play(“animationName”);
}
}
thanks for your help to solved my problem ![]()