can any one tell me whats wrong with my code
code:
using UnityEngine;
using System.Collections;
public class tawfe2health : MonoBehaviour {
public int maxHealth = 100;
public int curHealth = 100;
public float healthBarLength;
// Use this for initialization
void Start () {
healthBarLength = Screen.width / 2;
}
// Update is called once per frame
void Update () {
AddjustCurrentHealth(0);
if(curHealth == 0){
transform.Position = new Vector3(13.70886, 0.5421925, 3.211538);
}
}
void OnGUI() {
GUI.Box(new Rect(10, 10, healthBarLength, 20), curHealth + "/" + maxHealth);
}
public void AddjustCurrentHealth(int adj) {
curHealth += adj;
if(curHealth < 0)
curHealth = 0;
if(curHealth > maxHealth)
curHealth = maxHealth;
if(maxHealth < 1)
maxHealth = 1;
healthBarLength = (Screen.width / 2) * (curHealth / (float)maxHealth);
}
}
errors i am getting
1-Assets/Standard Assets/player/tawfe2health.cs(22,72): error CS1502: The best overloaded method match for `UnityEngine.Vector3.Vector3(float, float, float)’ has some invalid arguments
2-ssets/Standard Assets/player/tawfe2health.cs(22,72): error CS1503: Argument #1' cannot convert
double’ expression to type `float’
3-Assets/Standard Assets/player/tawfe2health.cs(22,19): error CS1061: Type UnityEngine.Transform' does not contain a definition for
Position’ and no extension method Position' of type
UnityEngine.Transform’ could be found (are you missing a using directive or an assembly reference?)
thanks in advance