Raycast with SendMessage can send Parameter, but how to send a variable ?

Hello Guys,
I am relatively new to Unity but normally i can figure out any problem. But this time, i dont find anything about it or at least i cant find a working answer, so if it exists already, just post the link.
My Problem is that, i have a Raycast, it hits my Target and with ‘SendMessage’ i apply damage to it:
hit.transform.SendMessage (“ApplyDamage”, 1.0F, SendMessageOptions.RequireReceiver); - (function on the target)- void ApplyDamage (float damage) {
healthPoints -= damage;
and the target looses 1 health, so this works just fine, but instead of 1.0f I want to send a variable (‘Damage’), so that the amount of health lost depends on that variable, but just replacing the 1.0f with the variable wont work, so how could I do this ?

There shouldn’t be any issues whatsoever sending a float variable in place of an explicit value.

float damage = 1.0f;
hit.transform.SendMessage ("ApplyDamage", damage, SendMessageOptions.RequireReceiver);

should be just fine as well as doing some work on the value of damage

float damage = 1.0f * 10 * time.deltaTime; // or whatever
hit.transform.SendMessage ("ApplyDamage", damage, SendMessageOptions.RequireReceiver);

SendMessage for the value passed takes an object, the very base of all things(for the most part) and matches your methods/functions by the signature. In case above, it will look for a method/function called ApplyDamange with a parameter/argument of type float as you have already noticed i’m sure, this should be no different when passing an explicit variable.

Ok, it was definitly a bug, just for ‘fun’ i made a new float (exactly the same as before, just different name, damage2) and replace the parameter name with that, and it works now. Whatever this was, using the variable damage doesn’t work and damage2 DOES WORK for some reason.

Still, thank you @Landern