Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

what is wrong here trying to make my player take damage by a projectile

$
0
0
this is the error Assets\HealthBar.cs(30,4): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement this is the code > using System.Collections; using> System.Collections.Generic; using> UnityEngine; using UnityEngine.UI;>> public class HealthBar : MonoBehaviour> { public float health; public Slider> slider; public Gradient gradient;> public Image fill;>> public void SetMaxHealth(int health)> { slider.maxValue = health;> slider.value = health;>> fill.color = gradient.Evaluate(1f);> }>> public void SetHealth(int health) {> slider.value = health;>> fill.color => gradient.Evaluate(slider.normalizedValue);> } void OnCollisionEnter(Collision> obj) { if> (obj.gameObject.tag=="Projectile")> health - health - 1f; }>> }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>