How I can get only varies values of the coordinate

On 22/03/2016 at 06:24, xxxxxxxx wrote:
In the example of the output (the console) output coordinates X and Y independently of whether they change or not.

How to make the output (the console) shows only varies values of the coordinates?
For example, if the cube to move along the X axis, the output only to the X
To move along the Y axis, in the console only changing the values of the coordinates of Y (x is no longer needed, since it does not change)

On 22/03/2016 at 06:47, xxxxxxxx wrote:

Not really SDK related, right? Check this (very recent) thread to find out how to figure if a
value changed between frames/execution passes.


On 22/03/2016 at 23:57, xxxxxxxx wrote:

it does not work

NiklasR, please example

On 23/03/2016 at 02:34, xxxxxxxx wrote:

Hello and welcome,

could you please copy your code directly into your posts and don't use screenshots? This would make it much easier for everyone to take at look at your code.

As Niklas pointed out you have to compare the current value with the previous value if you want to check if a value has changed. I would suggest to use some User Data for this (as shown in the linked thread).

If you want to use a variable within your Python code you must read the error message. To access a global variable in a local scope you have to use the keyword "global". See "What are the rules for local and global variables in Python?" and "Use of "global" keyword in Python".

best wishes,

On 23/03/2016 at 03:11, xxxxxxxx wrote:

All it works
I needed to add the line
global x0
global z0
I did not know that
thank you