// DETECTION BUG: CAUSE OF OVERDAMAGE AND OVERKNOCKBACK private void OnTriggerEnter(Collider other) { // Take damage, Melee if (other.gameObject.layer == 11) { Debug.Log("OW!"); CombatConductor mDmg = other.GetComponentInParent <CombatConductor>(); TakeDamage(mDmg.meleeDamage); } // Take damage, projectiles if (other.gameObject.layer == 12) { Debug.Log("OW!"); ProjectileTranslation a1Dmg = other.GetComponentInParent <ProjectileTranslation>(); TakeDamage(a1Dmg.a1Damage); } // Knockback if player collides if (other.gameObject.tag == "Player") { Rigidbody knock = other.GetComponent <Rigidbody>(); Vector3 force = (other.transform.position - transform.position).normalized; knock.AddRelativeForce(force * knockForce, ForceMode.Impulse); } }
private void Start() { // In start becuase parent only exist once this object spawned (as child). combatRef = GetComponentInParent <CombatConductor>(); mouseInfoRef = GetComponentInParent <PlayerCharacter>(); combatRef.GetStarShotRef(); origin = GameObject.FindGameObjectWithTag("Player"); }
private void OnTriggerStay(Collider other) { // Take damage, ability2 if (other.GetComponent <RadiantSun>()) { float delta = Time.deltaTime; CombatConductor a2Dmg = other.GetComponentInParent <CombatConductor>(); TakeDamage(a2Dmg.a2_damage * delta); } }
void Start() { combatRef = GameObject.FindGameObjectWithTag("Player").GetComponent <CombatConductor>(); colliders = GetComponents <BoxCollider>(); rend = GetComponent <Renderer>(); gameObject.tag = "Passable"; colliders[0].isTrigger = false; colliders[1].isTrigger = true; }
public Renderer rend; // Player renderer // Use this for initialization void Start() { // Player Renderer rend = GetComponentInParent <Renderer>(); moveReference = GetComponentInParent <PlayerCharacter>(); combatRef = GetComponentInParent <CombatConductor>(); combatRef.GetAscensionRef(); if (combatRef.a4_active) { float speed = moveReference.moveSpeed + 1; moveReference.moveSpeed = speed; } }
void Start() { // In start becuase parent only exist once this object spawned (as child). combatRef = GetComponentInParent <CombatConductor>(); combatRef.GetRadiantSunRef(); }
void Start() { meleeColliderRef = GetComponentInChildren <CapsuleCollider>(); meleeColliderRef.enabled = false; combatRef = GetComponentInParent <CombatConductor>(); }
void Start() { combatRef = GameObject.FindGameObjectWithTag("Player").GetComponent <CombatConductor>(); }
void Start() { combatRef = GetComponentInParent <CombatConductor>(); combatRef.GetSpacialSuspensionRef(); }