Hello,
I have a script for setting the enemies health when taking damage from a bullet. Its one method below in the code section, updates the health. It works well in unity editor. But in an android device, when the m_slider.value reaches the half value of the m_StartingHealth, it will cause a lag about 1-2 second for every colliding bullet. I can not figure out why, but that is just because of the “m_Slider.value = m_CurrentHealth” line. If i comment that part, it will work well. You can see the slider and filling images properities from the attachment. I will be pleased if you can help.
m_StartingHealth = 100.0f,
private void SetHealthUI ()
{
// Set the slider's value appropriately.
m_Slider.value = m_CurrentHealth;
m_FillImage.color = Color.Lerp (m_ZeroHealthColor, m_FullHealthColor, m_CurrentHealth / m_StartingHealth);
}