#Georgios1999's problem

1 messages · Page 1 of 1 (latest)

velvet island
#

When I try that it prints out the same with the previous one: The type or namespace name 'batteryLevel' does not exist in the namespace 'SystemInformation' (are you missing an assembly reference?)

#

hmm

next lake
#

Idk why you're writing that

#

It's just SystemInfo.batteryLevel

velvet island
#

in the explorer I find 15 different System.Management.dll.

next lake
#

Cool story but you don't need any of them

velvet island
next lake
#

I just linked you. Unity provides this

#

You don't need a DLL or anything

velvet island
#

Then why doens't it work? (even without the ddls)

next lake
#

Show your code

velvet island
#

ok wait

next lake
#

You're definitely overcomplicating it

velvet island
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.UI;
using TMPro;
using System.Management;

namespace SystemInformation
{
    public class battery : MonoBehaviour
    {
        void Start()
        {
            Debug.Log(SystemInformation.batteryLevel);
        }
    }
}
next lake
#

Again

#

SystemInfo.batteryLevel, not what you wrote

#

Also

#

Why is your code in a SystemInformation namespace

velvet island
#

because Google told me to

#

i guess

next lake
#

It didn't

#

You misunderstood

velvet island
#

of course i did

#

ok so I removed it but it keeps the same error

next lake
#

Removed what

velvet island
#

the namespace thing

next lake
#

Did you change your code to
SystemInfo.batteryLevel yet?

#

This is very simple

velvet island
#

i did

next lake
#

Show the current code

#

And any current error

velvet island
#

ok

#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.UI;
using TMPro;
using System.Management;

public class battery : MonoBehaviour
{
    void Start()
    {
        Debug.Log(SystemInfo.batteryLevel);
    }
}
#

this is the current code

next lake
#

Ok and what error do you get if any

velvet island
#

this

next lake
#

Just delete that line

#

It's not needed

#

Line 7

velvet island
#

ok

#

oh my god it works