Help: AttributeError

I was running a script, and I got this error message.

AttributeError: not a sequence type, expected a sequence of numbers size 3

Does anyone know what this means? I’m pretty sure It has something to do with obj.setPosition.

import GameLogic 
cont = GameLogic.getCurrentController() 
obj = cont.getOwner() 
pos = GameLogic.globalDict["playerPosition"] 
print pos 

globalDict[“playerPosition”] is equal to obj.getPosition from another script.

Looks like you cant use something like this


use this instead




anyway this method is deprecated

If it’s deprected, is there another way to do it? Also, I changed the error message by using (pos[0],pos[1],pos[2]) as the setPosition. However, now I got this error message.

‘builtin_function_or_method’ object is unsubscriptable

Any ideas?

This is using Blender 2.49.2 and Python 2.6.2 …

My problem is setting the position of an object based on it’s previous position. While I appreciate the .blend, It does not address my problem.

Just store the players position in the global variable and call it when needed. You may need to post a blend to get more help.

Here is an example using two scripts…

position, worldPosition, localPosition (and the depricated setPosition()) expect a list with 3 numeric items. If you provide a non-list you will get this error. (see

You can do this:

obj.position=[1.1, 0.0, 0.234142]  #or obj.setPosition([1.1, 0.0, 0.234142] )

referring to your first post (assuming that pos is the result of obj.getposition() from another script):


I hope it helps

Heres the .blend of an example using my script.


GameSaveLoad.blend (130 KB)

Here is a working setup with your scripts. There was a problem using getPositon() instead of using obj.position.