SendMessage has no receiver

hi i get an error on my c# script
“SendMessage GetSpeed has no receiver”

gameObject.SendMessage ("GetSpeed", dir);

here is my receiver
void GetSpeed(Vector3 thespeed)
{
speed= thespeed.magnitude;
}// GetSpeed

the strange thing is that the function receives the call and works fine.
any ideas on that?

Try BroadcastMessage. My guess is you’re sending to the parent of the object where your script actually is?