TypeError: 'KX_PythonSeq' object is not callable

Hi,

I want to write simple script which give me some basic tile movement by changing position of object

this is my lame script


cont = GameLogic.getCurrentController() 
own = cont.owner 
 
pos = own.localPosition 

forward = cont.sensors("Wkey") 
 
move = 2     
 
if forward.isPositive(): 
    pos = [lx, ly+move, lz]

but after running game and pressing W I get this error in blender console:

Python script error from controller "cont#CONTR#1":
Traceback (most recent call last):
  File "tilemove_alpha01", line 6, in <module>
TypeError: 'KX_PythonSeq' object is not callable

what’s wrong? :spin:
thx

use [] for sequences, no ()!

thanks :slight_smile:

it’s working now, here is how it’s looking


cont = GameLogic.getCurrentController() 
 
own = cont.owner 
  
pos = own.localPosition 
 
forward = cont.sensors["Wkey"] 
backward = cont.sensors["Skey"] 

move = 2 
  
if forward.positive: 
    pos[1] += move 
if backward.positive: 
    pos[1] -= move 
     
own.localPosition = pos