Mariano
New member
Hello community:
I am designing the enemies and within the script that goes into the enemy are these lines that refer to the damage done to the player.
The problem is that within Unity it works perfectly, but when I run it on the cell phone the player is not damaged.
What will be happening?
Are those damage script lines fine?
Damage occurs when the attack animation ends with EndAttack
¡Salud!
I am designing the enemies and within the script that goes into the enemy are these lines that refer to the damage done to the player.
The problem is that within Unity it works perfectly, but when I run it on the cell phone the player is not damaged.
What will be happening?
Are those damage script lines fine?
Damage occurs when the attack animation ends with EndAttack
Code:
public void EndAttack()
{
float dist = Vector3.Distance(Player.transform.position, this.transform.position);
if (dist < meleeAtackRange)
{
Player.SendMessage("Damage", meleeDamage, SendMessageOptions.DontRequireReceiver);
if (audioSource != null && SoundMelee != null)
{
audioSource.pitch = Time.timeScale;
audioSource.PlayOneShot(SoundMelee);
}
//audioSource.PlayOneShot(SoundMelee);
}
}
¡Salud!