So I have been using this code to broadcast coordinates so other objects can read the properties. The problem is that when I an using a vector I cannot tell if it is in the negatives or positives. Plus when I'm using a parented set, it goes off the median object location.

import mathutils
import bge

owner = bge.logic.getCurrentController().owner
positionToCheck = owner.worldPosition
positionToCompareTo = mathutils.Vector([0,0,0])
cont = bge.logic.getCurrentController()
own = cont.owner

own["position.x"] = float(abs(owner.worldPosition.x))
own["position.y"] = float(abs(owner.worldPosition.y))

The position.x and y are properties on the given object that I make other objects read for various reasons. I'd like another way to accomplish this without a vector.


enter image description here So this is the code I ended up using. But then I realized I can just check the worldPosition.x and y directly. So this was kind of a dumb question sorry


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.