0
$\begingroup$

This and/or how to access and change them in a script.

If you use the .getPropertyNames()-function of an object it only provides you with a list of the names of the properties. How can one actually change them?

Also you could use a property actuator with the python controller but the property and python controller are on 2 different objects. So it is about changing game properties of another object.

$\endgroup$

1 Answer 1

2
$\begingroup$

Use the object like a dictionary to access and change properties

# Access
print (object['propertyname'])

# Change
object['propertyname'] = 4
$\endgroup$
2
  • $\begingroup$ @Jonathan, see, I was right $\endgroup$
    – ruckus
    Commented Aug 17, 2015 at 15:39
  • $\begingroup$ Thanks a lot! I probably could not have found that out by googling and checking the documentation. $\endgroup$
    – Jonathan
    Commented Aug 17, 2015 at 19:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .