Python set position?

I was trying to make a demo to help someone on the forums, however i’ve found it’s not working :confused:


controller = GameLogic.getCurrentController()
owner = controller.owner
#script controller is on the camera, attatch other sensors to the camera controller.

#object sensor is an always sensor
object = controller.sensors["object"].owner
owner.position[0] = object.position[0]

why won’t it work?

Is the sensor “object” really at a different object than the controller?

Like Monster, the only thing I can see from the code is that the ‘sensors[‘object’].owner’ object is the same as the script-running object.

I SOLVED IT, the sensors are all fine, but you can’t use object.position[1] etc like that :confused:

Not in 2.49. That is true.
You have to set the complete list. Yes this is not that obvious.

But you can in 2.5x

thanks Monster