Let’s say, i’ve got a script that runs in every frame and it’s owner - dynamic object.
I bring it above for both blender versions.
obj = GameLogic.getCurrentController().owner pos = obj.position pos += 1 print (pos)
import bge obj = bge.logic.getCurrentController().owner pos = obj.position pos += 1 print (pos)
Script, defines a local variable ‘pos’ equals owner’s position, and increases it’s last coordinate.
The strange thing is, in 2.5 changing variable pos changes the object’s position.
Is it bug, feature or my incompetence?
And in last two cases, how to take some object’s parameter for further calculations without changing it?