Too many Sensors leading to Python-Controller

Heyho everyone,

in my Game I got plenty of mouse over sensors (+100). And it should all be processed by one python script…

I realised that the Controller brick doesn`t take more than 100 Input signals…

Is there any way around it to get these Sensor-signals into the same script?

Thaanks for any Information or advice!!

Clearly a sign of a weak design.

You should analyse your situation. Ask yourself - do i really need that much sensors of the same type? What of I need another one?

I guess you want to sense when the mouse cursor is over a certain mesh/object. If that is the current object or one that is strongly bound together with the current one this is fine the mouse over is fine.

But if you want to detect other objects you need a dynamic approach. You get that with mouse over any. (Keep in mind the mouse cursor can only be over a single object at the time.) Due to the dynamic result of the mouse over any (see API for details) you need a Python controller to setup or perform the operation you want to perform with the sensed object.

I hope this helps.

Rather than having a million “mouse over object” sensors, there are other ways. The best (in my opinion) is to use a function to get the name of the object the mouse is over. There is one somewhere in the API, but i can’t remember what it is at the moment.

Anyway, once you have the object’s name, you can then do a simple if statement.

Thanks for the fast support guys! I see I have to gain more knowledge about the API…
Find a way to create a function which allows me to detect the Object on which the Cursor is over at the Moment…

Will Report if it worked out :slight_smile:

With your help I found a way to do it with the hitObject… maybe not elegant but functionable :slight_smile: graaazie