Quantcast
Channel: Answers for "Public boolean can't be accessed due to its protection level."
Browsing all 4 articles
Browse latest View live

Answer by YoungDeveloper

You are accessing isDead like a static variable. Use Getcomponent from gameobject which holds that playerscript instance or set is isDead static, which i don't suggest as its player, and is not...

View Article



Answer by Drumedia

I would do this: using UnityEngine; using System.Collections; public class PlayerHealth : MonoBehaviour { public static PlayerHealth current; public bool isDead; void Start () { current = this; } } You...

View Article

Answer by YoungDeveloper

You are accessing isDead like a static variable. Use Getcomponent from gameobject which holds that playerscript instance or set is isDead static, which i don't suggest as its player, and is not...

View Article

Answer by drume3D

I would do this: using UnityEngine; using System.Collections; public class PlayerHealth : MonoBehaviour { public static PlayerHealth current; public bool isDead; void Start () { current = this; } } You...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images