|
using UnityEngine; using System.Collections; public class NewBehaviourScript : MonoBehaviour { public int maxHealth = 100; public int curHealth = 100;
(comments are locked)
|
|
It seems the error is at: (curHealth / (float))maxHealth; the correct sintax is: (curHealth / (float)maxHealth); thanks alot im new at this the help is appreciated
Jun 05 '11 at 09:16 PM
skyler396
(comments are locked)
|
|
Your last ) needs to move after the variable name. The console tells you what line numbers your error is on. Screen.width is an int, by the way, so you shouldn't do integer division with it, like you are. But the parentheses aren't helping you at all, and if you get rid of them, you don't need an explicit cast. You may want to store Screen.width * .5F / maxHealth as a variable to avoid an extra multiplication and a division all the time.
(comments are locked)
|
