Hello again… Just wondering how to check if an object has a property in a python script without using a “near” sensor or something of the like. I have:
import GameLogic
cont = GameLogic.getCurrentController()
own = cont.owner
for i in range(0, len(scene.objects))
subject = scene.objects[i]
if subject.has_key("lod"):
# ^this here is my problem...
if own.getDistanceTo(subject) > subject["lod"]:
subject.visible=0
I got “has_key” from another script, but honestly I have no idea what it does. Thanks!
import GameLogic
cont = GameLogic.getCurrentController()
own = cont.owner
for subject in scene.objects :
if "lod" in subject :
if own.getDistanceTo(subject) > subject["lod"] :
subject.visible=0