How do I trigger something when a game property equals a certain value?
So Here is what I have done.

myprop = own['prop']
if myprop == 50:
    own.applyRotation((0, 0, 0.5),True)

screen shot

  • $\begingroup$ Can you use logic bricks? $\endgroup$
    – Scalia
    Dec 25 '14 at 22:02

The script is checking if prop is an integer equal to 50, but the property is actually a string.

Solution 1

Change String to Integer in the Properties panel

Solution 2


if myprop == 50:


if myprop == '50':

Going forward if you enable the console (Window -> Toggle System Console) it will let you know when these sort of errors happen.


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.