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.getPosition() xdist = targetpos - mepos ydist = targetpos - mepos zdist = targetpos - mepos if mepos != targetpos: newpos = [mepos+xdist*0.1,mepos+ydist*0.1,mepos+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!