Hi.i’ve build a game and it plays with no problems on pc and android simulator but when i test it on devices it freezes when the bullet prefab collides with the enemy.it goes down to 1-2 fps or smth or sometimes it randomly freezes.What can be the cause?
devices tested:iphone 6s, samsung galaxy s6.
so the problem was my enemy’s health bar script
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class MonkeyHealthBar : MonoBehaviour {
public float fillAmount;
public float tempHealth;
public float maxHealth;
public monkey monkeyScript;
public Image content;
void Update ()
{
tempHealth = monkeyScript.tempHealth;
maxHealth = monkeyScript.maxHealth;
fillAmount = tempHealth / maxHealth;
content.fillAmount = fillAmount;
}
}
does anyone know the reason??
@aditya007 @Landern