How do i go about telling blender to look at the next value in a list. ie.
import GameLogic as GL
me = GL.getCurrentController().getOwner()
target1 = GL.getCurrentScene().getObjectList()["OBSphere.001"]
target2 = GL.getCurrentScene().getObjectList()["OBSphere.002"]
target3 = GL.getCurrentScene().getObjectList()["OBSphere"]
reportpoint = [target1, target2, target3]
mepos = me.getPosition()
targetpos = reportpoint[0].getPosition()
xdist = targetpos[0] - mepos[0]
ydist = targetpos[1] - mepos[1]
zdist = targetpos[2] - mepos[2]
if mepos != targetpos:
newpos = [mepos[0]+xdist*0.1,mepos[1]+ydist*0.1,mepos[2]+zdist*0.1]
me.setPosition(newpos)
What i want the code to do is when mepos = targetpos, it should then redefine targetpos to look at the next item in reportpoint list. Im very new to python as you can probably see. I’ve probably gone completey off of what im supposed to do :-?
Any help greatly appreciated!