How to connect logic nodes in an addon?

Hello! My friend is making an addon for UPBGE 2.5 which is aimed to add a custom made 2d filter to the empty object which it spawns, and the addon auto automatically forms the logic bricks in the empty object as it should do, but, those logic bricks are not connected to each other

See the above pic, the addon spwans the logic bricks but doesn’t connect them, so I want to ask how to do it in the addon? (btw this ia custom made addon)

And in the above pic, he wants to connect the sensor to the python controller and to connect this python controller to both the actuators, please tell how to do that, thanks!

I’d have to look it up now, but if I remember correctly, each brick has a link method attached, so you could do something like

sensor.link(controller)

I’ll look it up

EDIT:
Yeah thats the way to do it, you can check it here in line 719 and above:
https://github.com/IzaZed/Uchronian-Logic-UPBGE-Logic-Nodes/blob/master/ops/init.py

1 Like