Can't get bool from raycast hit object with tag?

Hi,

If I use Ray cast and check if I hit a certain player by using tag, how do I then access that hit objects scripts to check a bool?

    //First I check if my ray has hit the player tagged "John"
if (hitTransform.gameObject.tag ==  "John" )
            {

                fxManager.GetComponent<PhotonView>().RPC("BloodSplash", PhotonTargets.All, transform.position, hitPoint, transform.rotation);
                fxManager.GetComponent<PhotonView>().RPC("BloodSplash2", PhotonTargets.All, transform.position, hitPoint, transform.rotation);

                    myAttacker = this.name;
                    //MyAttackerAttacks();

                    //gameObject.GetComponent<Health>();



//Then I want to acces John's health script to see if his bool "dead" is true at the same time, but this doesn't work:
                if (hitTransform.gameObject.GetComponent<Health>().dead )
                {
                        deadShooter = false;
                        Debug.Log("it works");
                }
                }

The debug is never called, the "deadShooter " bool never becomes false. How do I do this and what am I doing wrong? All help is greatly appreciated

How is that link helpful to my specific question? All it says is how Raycast works, not how I acces the hit objects scripts

Anybody?

I probably misunderstood your issue, although with Photon involved, this might be a Photon issue more so than a Unity one. Are you absolutely sure Gameobject tagged “John” has the “Health” component?