[Bf-committers] Create Link between logic bricks with Python

Alex Fraser adfries at vpac.org
Wed Jun 29 07:07:28 CEST 2011


Hi Sven,

----- Original Message -----
> From: "Sven von Brand" <svbrand at alumnos.inf.utfsm.cl>
>
> I added the logic brick with
> bpy.ops.logic.sensor_add(type='ALWAYS',name="Name",object="Cube") and
> supposed there was something like
> bpy.ops.logic.link(sensor="",sensobject="", controller="",
> contobject="") but could not find anything like it.

Try something like this:

ob.game.sensors['Name'].link(ob.game.controllers['And'])

where ob is the object you added the bricks to.

Cheers,
Alex


More information about the Bf-committers mailing list