- Home /
SendMessage has no Receiver
I'm following the BurgzergArcade tutorial series, and I encounter this problem at tutorial 265.
I am just starting out learning code. I have an AI script on my Goblin enemy characters, and in that script there is this bit:
private void MeleeAttack(){
Debug.Log( "***Melee Attack***");
//set attackresettimer to the meleeAttackTimer
_me.meleeResetTimer = _me.meleeAttackTimer;
//deal with animations
SendMessage(" PlayMeleeAttack");
//decide if we hit or not first
if(true){
//do something
Debug.Log("We Hit!");
}
else{
//do something
Debug.Log("We Miss!");
}
When I go up to the goblin, instead of playing the animation (it has one so thats not it), I receive the error
SendMessage PlayMeleeAttack has no receiver! UnityEngine.Component:SendMessage(String)
To sum up:
enemy has animations and AI script
When enemy is supposed to play attack animation I receive the error
I hope this is enough information, and thanks in advance!
Thanks! The problem was in fact that stupid space.
Cheers!
Fantastic, converted to answer. Don't forget to set question as answered
Answer by Linus · Jun 30, 2013 at 02:55 PM
SendMessage(" PlayMeleeAttack") is the space suppose to be there? post the link se we/I can better see the context
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
TNT Damage Receiver 1 Answer
Play animation once 1 Answer
Play animation for horizontal and vertical movement? 1 Answer
Mixamo Call Animation from Script 0 Answers