Problem with calling a function from other scripts, Thanks.
Script A:
Script B Name = new Script B();
if (Physics.Raycast(ray, out hitInfo, weaponRange, mask))
{
Instantiate(impactEffect, hitInfo.point, Quaternion.LookRotation(hitInfo.normal));
if (hitInfo.collider.tag == "Player")
{
//other.CmdPlayerShot(hitInfo.collider.name);
Name.CmdPlayerShot(hitInfo.collider.name);
//Destroy(hitInfo.transform.gameObject);
return;
}
Script B:
[Command]
public void CmdPlayerShot(string _playerID)
{
Debug.Log(_playerID + "has been shot");
}
}