MissingMethodException error

Hi.

I met an error.


MissingMethodException: The best match for method ApplyDamage has some invalid parameter.
System.MonoType.InvokeMember (System.String name, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target, System.Object[ ] args, System.Reflection.ParameterModifier[ ] modifiers, System.Globalization.CultureInfo culture, System.String[ ] namedParameters) [0x00000]
System.Type.InvokeMember (System.String name, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target, System.Object[ ] args) [0x00000]
UnityEngine.SetupCoroutine.InvokeMember (System.Object behaviour, System.String name, System.Object variable)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UnityEngine.GameObject:GameObject$SendMessage$System.String$Damage$UnityEngine.SendMessageOptions(Object, Object[ ])
System.MulticastDelegate:invoke_object_object_object[ ](Object, Object[ ])
Boo.Lang.Runtime.RuntimeServices:smile:ispatch(Object, String, Type[ ], Object[ ], DispatcherFactory)
Boo.Lang.Runtime.RuntimeServices:smile:ispatch(Object, String, Object[ ], DispatcherFactory)
Boo.Lang.Runtime.RuntimeServices:Invoke(Object, String, Object[ ])
UnityScript.Lang.UnityRuntimeServices:Invoke(Object, String, Object[ ], Type)
orcarrowscript:OnCollisionEnter(Collision) (at Assets\Scripts\enemyarrowscript.js:38)

enemyarrowscript 38 line is,

function OnCollisionEnter(hit : Collision)  {
	if(go)
	{
	if (hit.gameObject.tag == "Player") { 
		hit.gameObject.SendMessage("ApplyDamage", omDamage, SendMessageOptions.DontRequireReceiver );

and omDamage is,

private var omDamage : Damage = new Damage();

Damage(); is a class like class Damage

I don’t know why this occur and how to fix.

Thanks for help.

how is your ApplyDamage() function defined?

Not special,

function ApplyDamage(incDamage : Damage)
{
	if (stats.curhp > 0)
	{		 
		 		 UI.hpDamage = Mathf.Round(incDamage.directDamage);		
   
		 		AudioSource.PlayClipAtPoint(hitSound, transform.position);	
		animation.CrossFade("hit",0.3 ,PlayMode.StopAll);

Is there any other script on the same GameObject that has a function called ApplyDamage?

Thanks, you are right.

I have another script that also has applydamage, but it is different with main script.

But I ignore it because I uncheck checkbox at the inspector’s component’s name’s side.

But it recognize as long as attached.