First, what do you mean a empty mesh, do you mean a empty object, a object with no mesh or a mesh with a fake user.
If it is one of the first two you will just have to use python and the function object.worldPosition, if it is a fake user I don’t think it has coordinates.
import bge
owner = bge.logic.getCurrentController().owner
scene = bge.logic.getCurrentScene()
#somehow put your key into here eith KX input or sensor:
key = . . .
emptyMesh = scene.objects["empty mesh"]
if key:
owner.worldPosition = emptyMesh.worldPosition
indeed, also very helpful, thankyou I think i can adapt that code to 2.49b ese
both of you have been very helpful, and I thankyou. I thought this sorta thing might have some sort of way to do it through the logic bricks (something I wasn’t seeing).
very well though, seems I’ll have to do a bit more scripting.
again thanks.
actually let me tell you the full usage of this, I want to use it for spawning enemies and or the player at different places. (like in the instance that you just start the game your character starts from a specific point)
would the code you gave be the most addequate way to do such?
import GameLogic as gl
obl = gl.getCurrentScene().getObjectList()
cont = gl.getCurrentController()
own = cont.getOwner()
sen = cont.sensors
act = cont.actuators
player = obl["OBPlayer"]
player.setPosition(own.getPosition())
It’s a basic template. You’ll need to put this on the empty that you want to snap the player to. And the player needs to be named “Player” for this specific script.
(Sorry if you know all this. Just wanted to help.)
very good, and thanks, I knew most of these before, get and set position thats what I needed, mercy I have used those two before why couldn’t I remember get and set?