void OnCollisionEnter(Collision col) { ContactPoint cp = col.contacts[0]; GameObject GG = col.gameObject; if (GG.tag == "Player") { PN = GG.GetComponent<PlayerNetwork>(); PN.RpcApplyStatusEffectClient(StatusEffectHandler.EffectType.HIT); PN.GetStatusEffectHandler().AddStatusEffect(StatusEffectHandler.EffectType.HIT); GameObject.Instantiate(explosionPrefab, transform.position, new Quaternion()); Destroy(gameObject); } }
void OnCollisionEnter(Collision col) { ContactPoint cp = col.contacts[0]; GameObject GG = col.gameObject; if (GG.tag == "Player") { PN = GG.GetComponent <PlayerNetwork>(); PN.RpcApplyStatusEffectClient(StatusEffectHandler.EffectType.HIT); PN.GetStatusEffectHandler().AddStatusEffect(StatusEffectHandler.EffectType.HIT); GameObject.Instantiate(explosionPrefab, transform.position, new Quaternion()); Destroy(gameObject); } }
void OnCollisionEnter(Collision col) { ContactPoint cp = col.contacts[0]; GameObject GG = col.gameObject; rb.velocity = Vector3.Reflect(oldVel, cp.normal); rb.velocity += cp.normal * 2.0f; Vector3 tempVel = rb.velocity; tempVel.y = 0.0f; rb.velocity = tempVel; if(GG.tag == "Player") { PN = GG.GetComponent<PlayerNetwork>(); PN.RpcApplyStatusEffectClient(StatusEffectHandler.EffectType.HIT); PN.GetStatusEffectHandler().AddStatusEffect(StatusEffectHandler.EffectType.HIT); Destroy(gameObject); } }
void OnCollisionEnter(Collision col) { ContactPoint cp = col.contacts[0]; GameObject GG = col.gameObject; rb.velocity = Vector3.Reflect(oldVel, cp.normal); rb.velocity += cp.normal * 2.0f; Vector3 tempVel = rb.velocity; tempVel.y = 0.0f; rb.velocity = tempVel; if (GG.tag == "Player") { PN = GG.GetComponent <PlayerNetwork>(); PN.RpcApplyStatusEffectClient(StatusEffectHandler.EffectType.HIT); PN.GetStatusEffectHandler().AddStatusEffect(StatusEffectHandler.EffectType.HIT); Destroy(gameObject); } }