Question by
FrenchFryKy · Dec 16, 2015 at 01:10 PM ·
errorfloatcompiler errorhealthbarcompile-error
Unexpected Symbol 'float'
I am making this script for health, and I am trying to clean up this error. If you can tell, I'm kind of new to Unity
healthText.text = string.Format ("+ {0}", CurrentHealth ) float currentXValue = MapValues ((CurrentHealth, 0, maxHealth, minXValue, maxXValue) ;
Comment
Thanks! It worked. Can you help me out with something else? It also says I have a parsing error
private void $$anonymous$$apValues(float x, float in$$anonymous$$in, float in$$anonymous$$ax, float out$$anonymous$$in, float out$$anonymous$$ax)
{
return (x - in$$anonymous$$in) * (out$$anonymous$$ax - out$$anonymous$$in) / (in$$anonymous$$ax - in$$anonymous$$in) + out$$anonymous$$in;
}
how about parsing?
private void $$anonymous$$apValues(float x, float in$$anonymous$$in, float in$$anonymous$$ax, float out$$anonymous$$in, float out$$anonymous$$ax)
{
return (x - in$$anonymous$$in) * (out$$anonymous$$ax - out$$anonymous$$in) / (in$$anonymous$$ax - in$$anonymous$$in) + out$$anonymous$$in;
}
Return type float, not void
private float $$anonymous$$apValues(float x, float in$$anonymous$$in, float in$$anonymous$$ax, float out$$anonymous$$in, float out$$anonymous$$ax)
{
return (x - in$$anonymous$$in) * (out$$anonymous$$ax - out$$anonymous$$in) / (in$$anonymous$$ax - in$$anonymous$$in) + out$$anonymous$$in;
}