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$
2
$\begingroup$

Use the object like a dictionary to access and change properties

# Access
print (object['propertyname'])

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.