I’ve recently been working on a money, heat and etc calculator for my game. Except, when I place a solar panel next to a generator, it starts making money, but when I bring an item or unit close, my money turns to NaN and thus, the engine doesn’t change it, even after keeping distance from the units.
Game link: http://www.modd.io/play/B3hfs2vbL
Even tho I tried to prevent this, the math still gives out a NaN. (Notice: “owner of selected unit” is an entity variable)