My enemy cant effect my player and my player cant effect my enemy! Why?

I have 4 scripts two for the health of enemy and player and two for the damage of the same two. The player and enemy won’t collide ,they just walk through each other. Help me please!

//SwordDamage Script
using UnityEngine;
using System.Collections;

public class SwordDamage : MonoBehaviour
{
	public GameObject target;
	public int swordDamage = 5;
	
	
	public void AttackEnemy(){
		EnemyHealth eh = (EnemyHealth)target.GetComponent ("EnemyHealth");
		eh.AdjustcurEnemyHealth (-swordDamage);
	}
	void OnColliderHit(){
		AttackEnemy ();
	}
	void Update(){
		if (Input.GetButtonDown ("Fire1")){
			// runs this code when the fire button is pressed down
			animation.Play(); // this will play the default animation on this object
		}
	}
}
//Players Health script
using UnityEngine;
using System.Collections;

public class PlayerHealth : MonoBehaviour
{
	private int maxHealth = 100;
	public int curHealth = 100;
	private float healthBarLength;
	void Start(){
		healthBarLength = Screen.width / 2;
	}
	void Update(){
		AdjustcurHealth (0);
	}
	void OnGUI(){
		GUI.Box (new Rect(10,10, healthBarLength, 20),curHealth + "/" + maxHealth);
	}
	public void AdjustcurHealth(int adj){
		curHealth += adj;

		if(curHealth <= 0)
			curHealth = 0;

		if(curHealth > maxHealth)
			curHealth = maxHealth;

		if(maxHealth < 1)
			maxHealth = 1;

		if(curHealth <= 0)
			//Dead

		healthBarLength = (Screen.width / 2) * (curHealth / (float)maxHealth);

	}
}
//enemy's health script
using UnityEngine;
using System.Collections;

public class EnemyHealth : MonoBehaviour
{	
	public int enemyHealth = 15;
	public int curEnemyHealth = 15;

	void Update(){
		AdjustcurEnemyHealth (0);
	}
	public void EnemyDied(int d){
		Destroy (gameObject);
	}
	public void AdjustcurEnemyHealth(int adj){
		curEnemyHealth += adj;
		
		if(curEnemyHealth <= 0)
			curEnemyHealth = 0;
		
		if(curEnemyHealth > enemyHealth)
			curEnemyHealth = enemyHealth;
		
		if(enemyHealth < 1)
			enemyHealth = 1;
		
		if (curEnemyHealth <= 0)
						EnemyDied (0);
	}
			


	
}
//Enemies attack script
using UnityEngine;
using System.Collections;

public class EnemyAttack : MonoBehaviour
{	
	public GameObject target;
	public int enemyDamage = 15;


		public void Attack(){
			PlayerHealth eh = (PlayerHealth)target.GetComponent ("PlayerHealth");
		eh.AdjustcurHealth (-enemyDamage);
		}
	void OnColliderHit(){
		Attack ();
	}
}

If they aren’t colliding, it’s nothing to do with your health decrease script. Do both objects have a collider? Does at least one have a rigidbody? Have you set the rigidbody’s collision detection to continuous/continuous dynamic? Did you change the collision layers to make one layer ignore another layer? If you are using mesh collider, did you enable convex?

They are now collididing ,but it still doesnt take away from my health or the enemy still deosnt die after calculated amount of hits. Please help!

Pretty sure OnColliderHit is not a built in collision function so will never be called unless you call it yourself. Better look up collider and collision functions… I’d drop a link but it’s a bit too hard on my phone.

check out colliders here : Colliders

specifically you are probably looking for this : OnCollisionEnter