Player will not die when playing the game.
Below error is appearing in the errors list.
“BroadcastMessage PlayerDied has no receiver!”
Please help me on this.
Player will not die when playing the game.
Below error is appearing in the errors list.
“BroadcastMessage PlayerDied has no receiver!”
Please help me on this.
BroadcastMessage actually calls the specified function (“PlayerDied” in this case) in any script attached to the target object or any of its children. If none of these scripts have such function, this error message is printed in the console. Check if this function really exists in some player script; if it exists, maybe the projectile (or whatever should hit the player) is hitting another object that obviously doesn’t have such function. In this case, add DontRequireReceiver to BroadcastMessage to solve the problem - for example:
hit.collider.BroadcastMessage("PlayerDied", SendMessageOptions.DontRequireReceiver);