this is the current code, what i thought might work was accessing the players decal system which contains blood hit effects. Grabbing the players own blood hit effect and playing that particle at the point where the player was hit, though its def not working. Any help would be greatly appreciated! Thanks!
public void RaycastFire()
{
if (GetComponent().isMine)
{
if (!wepSystemReferences.wepHook.weapon_Type.Shotgun)
{
if (Physics.Raycast(Camera.main.transform.TransformPoint(new Vector3(0, 0, 2.5f)), Camera.main.transform.forward + shootOffset, out hit, 500))
{
// Calls Hit effect
GetComponent().RPC("Hiteffect", PhotonTargets.All, Camera.main.transform.TransformPoint(new Vector3(0, 0, 2.5f)), hit.point);
}
}
}
}
//This is called by RayCast fire, function above
[PunRPC]
public void Hiteffect(Vector3 s, Vector3 e)
{
if (hit.collider != null)
{
if (hit.transform.gameObject.tag == "Player" && !hit.transform.gameObject.GetComponent().isMine)
{
if (hit.transform.gameObject.GetComponent())
{
DecalSystem a = hit.transform.gameObject.GetComponent();
a.bloodPool.bloods[a.bloodPool.currentBlood].transform.position = hit.point;
ParticleSystem[] otherPlayerParticles = a.bloodPool.bloods[a.bloodPool.currentBlood].transform.GetComponentsInChildren();
foreach (ParticleSystem part in otherPlayerParticles)
{
part.Play();
}
}
}
}
}
//Called by my weapon InputHandlerpublic void RaycastFire()
{
if (GetComponent().isMine)
{
if (!wepSystemReferences.wepHook.weapon_Type.Shotgun)
{
if (Physics.Raycast(Camera.main.transform.TransformPoint(new Vector3(0, 0, 2.5f)), Camera.main.transform.forward + shootOffset, out hit, 500))
{
// Calls Hit effect
GetComponent().RPC("Hiteffect", PhotonTargets.All, Camera.main.transform.TransformPoint(new Vector3(0, 0, 2.5f)), hit.point);
}
}
}
}
//This is called by RayCast fire, function above
[PunRPC]
public void Hiteffect(Vector3 s, Vector3 e)
{
if (hit.collider != null)
{
if (hit.transform.gameObject.tag == "Player" && !hit.transform.gameObject.GetComponent().isMine)
{
if (hit.transform.gameObject.GetComponent())
{
DecalSystem a = hit.transform.gameObject.GetComponent();
a.bloodPool.bloods[a.bloodPool.currentBlood].transform.position = hit.point;
ParticleSystem[] otherPlayerParticles = a.bloodPool.bloods[a.bloodPool.currentBlood].transform.GetComponentsInChildren();
foreach (ParticleSystem part in otherPlayerParticles)
{
part.Play();
}
}
}
}
}