Quantcast
Channel: Questions in topic: "get"
Viewing all articles
Browse latest Browse all 215

C sharp get and set problem: "name doesn not exist in the current context

$
0
0
Hello, i got a problem with my code. I tried to make a get/set function for my life variable, but the get, set and value is always marked as red, with the information: "The name get does not exist in the current context" using UnityEngine; using System.Collections; public class PlayerController : MonoBehaviour { private int life; //return the life value public int Life() { get { return life; } set{ life = value; } } }

Viewing all articles
Browse latest Browse all 215

Trending Articles



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