will sone on tell me witch is the right way to fomat this
import GameLogic as g
cont = g.getCurrentController()
own = cont.getOwner()
ob = g.getCurrentScene().getObjectList()
object = [ ob["OBPlayer"] ]
own.getDistanceTo(object)
or is it
import GameLogic as g
cont = g.getCurrentController()
own = cont.getOwner()
ob = g.getCurrentScene().getObjectList()
own.getDistanceTo[ ob["OBPlayer"] ]
are ether of these right or am i doing somthing wrong
I dont know if syntactically they both are correct, but conceptually the first way is faster execution wise. In the first, object is the pointer to OBPlayer, and anytime in your entire code you want to reference it, you have it. In the second way, the interpreter has to defreference each time, and that slows it down.