There does not seem to be a working answer on any google result of Unity Answers link on how to get the current system/host CPU/MEM from within Unity. Any suggestions? This is the only result and yes I have tried it: https://answers.unity.com/questions/506736/measure-cpu-and-memory-load-in-code.html
If you're targeting windows specifically... you can probably use System.Diagnostics.PerformanceCounter. Here's a stackoverflow doing nearly exactly what you want: https://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-in-c It's getting CPU usage and available memory (memory unused). Annoying thing about PerformanceCounter is that you need to know the names of the strings to pass in, and they're pretty much unique to the platform. You can use the PerformanceCounterCategory class to get a list of them: https://docs.microsoft.com/en-us/do...rmancecountercategory?view=netframework-4.7.2 Like they show in this stackoverflow: https://stackoverflow.com/questions/23366831/c-sharp-performancecounter-list-of-possible-parameters It'll end up generating a pretty long list because well, there's a lot of performance counters in most modern systems. Figure out the ones you want and get the category/counter names and then stick them in. If you want to move platforms, you'll have to probably check that system's list for new ids. If you needed to deploy this, rather than using it internally, you'd want to do safety checks to make sure their system has them before going and starting it up. Less it throw an error.
Have you got this to work within Unity? The problem I and everyone on every post I can find is that it just shows 100% the whole time.
Never really used it in Unity, nope. Wouldn't surprise me if there were quarks though. Especially since they use a custom version of mono rather than .net. Is that only in the editor? You try building it and see what happens then? ... Have you considered launching a separate process outside of Unity and piping data from it to get the information needed? Maybe there's a C++/native plugin out there you can use? Or a C++/native snippet of code on a stackoverflow that you can adapt into your own plugin. ... But yeah, aside from the PerformanceCounter, I don't know a way specifically in the .net/mono library that does this. ... Personally I'm not sure the need of having it in a game. If I needed it, it's usually for debugging/performance testing. And in that case I just run a separate process for it. Like OpenHardwareMonitor, leave that open on a second screen, and I can see how my machine is doing while I play.