Can you create new sensors during game runtime?

The title say’s it all…

Can you add sensors to an objects during runtime, like you can properties ei:


if not "init" in own:
    own ["init"] = 0

Is there a way to do that, but with sensors, and actuators?

?? using a property to create a sensor looking for ??

You can adjust a target of a sensor, you can also have a item with a generic sensor, that you create and then refine, like a block with “Radar” or whatever and then change it’s properties,

what are you trying to achieve? this may generate a better answer,

if “blah blah blah”----------------------------and-------------------------Edit object-Add object-Radar blank

and in radar blank

if Radar-Property-RE-DEFINABLE------------------and------------------------------message-----To: RE-DEFINABLE message:REDEFINABLE

Thanks for the reply, what I wanted to do, can just be done by using pre-made objects. I was just curious to know if it was possible. I was looking through the api and it appears that you can edit the sensor list but it won’t apply any changes to the actual object, so I guess its not possible, anyways, again thanks for the reply:)

I did not say it was not possible, I just don’t know how,

also, you can have the “sensor” blank and “actuator” blanks on another layer, and then add object in the other layer, and change the settings of the armatures and sensors like who they target ect.

Ya ok thanks, I didn’t say you saied it wasn’t possible, sorry if it sounded that way, its the blender api that says its not possible;).

Yes, like the API said (nice job finding it, by the way), you can’t create sensors, actuators, or controllers while the BGE is running.

a objects KEY can be stored as a property right?

it would be neat to be able to use a property as a track to target etc,

like
own[‘Target’]=own.parent

and then in the logic
if Target!=Null---------------
always -------------------------and--------------------track to Target
always----------------------------python-Set target

for all actuators and sensors,
(instead of having to edit the track to target with python)

The Blender API allows you to do that.Be aware it belongs to Blender (bpy).

The BGE API does not support that.