i want to change position of “cube1” object behind of “Cube2” object.
So i need script. please help! :spin:
hi
if you want to change position of cube1 with python script just use:
cube1 = GameLogic.getCurrentScene().getObjectList()[“OBcube1”]
cube1.setPosition(x,y,z)
i want like this bu it is not true code
cube1.setPosition(cube2.x-22,cube2.y-33,cube2.z)
Attach this to Cube 2 :
import GameLogic as g
cont = g.getCurrentController()
own = cont.owner
obj = g.getCurrentScene().objects
Cube1 = obj["OBCube1"]
own.setPosition([Cube1.position[0] - 2,Cube1.position[1] - 3,Cube1.position[2]])
Check out http://www.tutorialsforblender3d.com/ for other useful python/Blender stuff!
import GameLogic as g
cont = g.getCurrentController()
own = cont.owner
obj = g.getCurrentScene().objects
Cube1 = obj[“OBCube1”]
Cube2 = obj[“OBCube2”]
own.setPosition([Cube2.position[0] - 2,Cube2.position[1] - 3,Cube2.position[2]])
it works really very thanks!