Can't switch status of objects in loop
Hey guys.

I've a little problem with the Simple Lights.

I can power them all, but i cant power it in a radius where i stand.

Working:
                        foreach (var light in UnityEngine.Object.FindObjectsOfType()) {
                            light.IOStateChanged(1, 1);
                        }​


Not working:
                List list = new List();
                Vis.Entities(player.transform.position, 10f, list);
                foreach (var entry in list) {
                    entry.IOStateChanged(1, 1);
                }​


List list = new List();
Vis.Entities(player.transform.position, 10f, list);
foreach (var entry in list) {
entry.IOStateChanged(1, 1);
}

i tested the list for the objects, they're there, but i cant switch the status of them, very odd.

does somebody can tell me why this isnt working in a radius?
Any solutions?

Thank you!
Try specifying type in list, like List<TYPE HERE>
i tried that already, no success... ;(
Make sure you specify a correct typ
i did, no success... always when i edit the thread, the <> Brakets get removed.
Hi,
I think you need type in three places.

List list = new List();Vis.Entities(player.transform.position, 10f, list);​

 

Not sure what the type is. Maybe BaseOven?

You'd probably need additional name/prefab checks to make sure you're targetting only the desired entities.
thank you guys, the fault was in entry.IOStateChanged(1, 1);
its changing like random... 1 of the 100 times, the command works. very strange