Help with Changing Picture With Orientation Sensor

Hi guys. Basically, I want to get my whale to change to looking right if i tilt my phone to the right, and change to looking left if I tilt my phone to the left. However, for some reason, nothing changes for like 99% of the times I tilt my phone. Can you please take a look at my blocks and tell me what's wrong?


Thanks in advance.

Nothing in your procedure refers to the orientation of the phone (its tilt.)

You also left out any info as to where or when that procedure is called (if ever.)

Oh sorry, I forgot to upload the picture of the orientation sensor blocks. I will upload later. For now, the heading blocks work, if I tilt to the right, it moves right, and vice versa.

Assuming you are actually calling that procedure after changing the Sprite Heading, here are corrections to your logic:

If heading between 90 and 270 (summarizing your test in the first if/then)
then set Whale Picture to WhaleLeft (assuming that points left, not having seen it)
ELSE set Whale Picture to WhaleRight (in the same test.)

Your second if/then test was overriding the first.

Feel free to export and upload your aia to allow testing.

Thank you for your help, but it still does not work. The whale just doesn't change picture as it moves to the left or right.

Here are the blocks.



Also, I read your suggestion.
I thought about what you wrote for the turning. Should I set the Whale Picture to Whale RIGHT for heading between 90 and 270 instead?

This must be a <


Or you could have just use an else statement as @ABG was suggesting it

Taifun

I can't comment further without an aia export.

There's too much wrong.