How do I inherit certain varibles and functions from another script.

using UnityEngine;

public class Projectile : MonoBehaviour
public GameObject explosionVFX;

public Weapon damage;

void OnTriggerEnter(Collider other)
    Instantiate(explosionVFX, transform.position, transform.rotation);

    if (other.GetComponent<EnemyHealth>() != null)


I have another script called weapon that has damage varibles and function I need on my projectile. No matter what I do it won’t work.

Right now your code is using composition rather than inheritance. Essentially, your projectile has a weapon, when you instead want your projectile to be a weapon. Change your Projectile class to inherit from Weapon instead of MonoBehaviour:

public class Projectile : Weapon