public static DamagePopup Create(Transform floatingDamage, Vector3 position, int damageAmount) { Transform floatingDmgPopupTransform = Instantiate(floatingDamage, position, Quaternion.identity); DamagePopup damagePopup = floatingDmgPopupTransform.GetComponent <DamagePopup>(); damagePopup.setup(damageAmount); return(damagePopup); }