# Script Help

**URL:** <https://blenderartists.org/t/script-help/559153>\
**Category:** Game Engine Support and Discussion\
**Created:** [December 10, 2012, 4:05pm UTC](https://blenderartists.org/t/script-help/559153 "2012-12-10T16:05:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GoshFather](https://blenderartists.org/user_avatar/blenderartists.org/goshfather/32/14037_2.png) [@GoshFather](https://blenderartists.org/u/GoshFather)\
**Post date:** [December 10, 2012, 4:05pm UTC](https://blenderartists.org/t/script-help/559153/1 "2012-12-10T16:05:34Z")

</div>

ok. I want to set the state of “Armature.006” and “Telekinesis Sensor” and also delete a property called “Telekinesis Sensor” from “Telekinesis Sensor” in the same script. The script seems to work just fine for setting the new state mask but when i add the code for deleting the property “telekinesis Sensor” it seems to then only delet the property but not change the state. any help? heres the script

import GameLogic  
scene = GameLogic.getCurrentScene()  
PowersOrigin = scene.objects[‘OBArmature.006’]  
TelekinesisSensor = scene.objects[‘OBTelekinesis Sensor’]  
Telekinesissensor.state = 2  
PowersOrigin.state = 1  
del TelekinesisSensor[“Telekinesis Sensor”]

---

<div class="post-metadata">

**Author:** ![SolarLune](https://blenderartists.org/user_avatar/blenderartists.org/solarlune/32/7258_2.png) [@SolarLune](https://blenderartists.org/u/SolarLune)\
**Post date:** [December 10, 2012, 5:59pm UTC](https://blenderartists.org/t/script-help/559153/2 "2012-12-10T17:59:14Z")

</div>

Nothing appears to be wrong with that script. Are there any errors in the console? How is the script being executed?

---

<div class="post-metadata">

**Author:** ![GoshFather](https://blenderartists.org/user_avatar/blenderartists.org/goshfather/32/14037_2.png) [@GoshFather](https://blenderartists.org/u/GoshFather)\
**Post date:** [December 12, 2012, 5:32pm UTC](https://blenderartists.org/t/script-help/559153/3 "2012-12-12T17:32:40Z")

</div>

no errors in the console. but i worked around it with another script that does the exact same thing but it goes about it in a different way. The new script that works id’s the Telekinetic object via its property and then deletes the property itself…hmmm

---

<div class="post-metadata">

**Author:** ![Monster](https://blenderartists.org/user_avatar/blenderartists.org/monster/32/2958_2.png) [@Monster](https://blenderartists.org/u/Monster)\
**Post date:** [December 12, 2012, 11:33pm UTC](https://blenderartists.org/t/script-help/559153/4 "2012-12-12T23:33:36Z")

</div>

From design perspective an object should not change the state of another one.

Reason: When analyzing the logic it is really hard to find where the state change comes from.

Other solutions:  
Notify the other object with messages.  
Notify the other object with properties.

Example: Looking at the above code I can’t tell what it is supposed to do. It looks like it changes states. But there is no information what that could mean.

Just my thoughts

---

<div class="post-metadata">

**Author:** ![GoshFather](https://blenderartists.org/user_avatar/blenderartists.org/goshfather/32/14037_2.png) [@GoshFather](https://blenderartists.org/u/GoshFather)\
**Post date:** [December 14, 2012, 3:57pm UTC](https://blenderartists.org/t/script-help/559153/5 "2012-12-14T15:57:38Z")

</div>

> [@Monster](#):
>
> From design perspective an object should not change the state of another one.
> 
> Reason: When analyzing the logic it is really hard to find where the state change comes from.
> 
> Other solutions:  
> Notify the other object with messages.  
> Notify the other object with properties.
> 
> Example: Looking at the above code I can’t tell what it is supposed to do. It looks like it changes states. But there is no information what that could mean.
> 
> Just my thoughts

Monster is pretty much right. I called the script from the object that held the property. However it only did it when I used the second script I made (where it id’s the object via its property, instead of identifying the object directly via  
obj = [‘OB’]
