I have a simple raycast method for shooting:
void Shoot ()
{
RaycastHit _hit;
if (Physics.Raycast(cam.transform.position, cam.transform.forward, out _hit, weapon.range, mask))
{
if (_hit.collider.tag == PLAYER_TAG)
{
CmdPlayerShot(_hit.collider.name);
}
//We hit something
Debug.Log("We hit " + _hit.collider.name);
}
The compiler returns UNetWeaver error: Script PlayerShoot uses the attribute [client] on the method shoot but is not a network behaviour.
It seems like I’m misunderstanding how this works??? The intended purpose is to have that method to be called on the client.