I’m trying to create a custom player bullet script extended from the base bullet script but the player bullet script won’t recognize the RaycastHit variable declared in the base script:
public class PlayerBullet : Bullet{
public override void DoHit(){
base.DoHit();
if(hit.collider.CompareTag("EnemyHead")){
Debug.Log("HeadHit!!");
}
}
}
The name `hit’ does not exist in the current context
RaycastHit hit;
Is declared in the DoHit() function in the base script. Do I still have to declare that again in the PlayerBullet script?