How can I get this to work?

I’m using this script to set my character’s location for his Special Attack setup:

import GameLogic
cont = GameLogic.getCurrentController()
owner = cont.getOwner()
scene = GameLogic.getCurrentScene()
empty = scene.getObjectList()["OBEmpty"]
owner.setPosition(empty.getPosition())
owner.setOrientation(empty.getOrientation())

The script works perfectly, but now I’ve discovered another problem. The character warps to the location like he’s suppose to, but he’s facing the wrong way. Is there a way to modify this script so that his position is set on the +y-axis? If so, can someone show me?

I don’t really understand what you’re asking.

  1. You said the character’s facing the wrong way. If that’s the problem, see if the empty is rotated wrong (Ctrl+A doesn’t work on empties).

  2. But you also said you wanted to set position on the y-axis. What do you mean by that?

i think what Toomai is trying to say is you need to either rotate your character or your empty so they have the same local orientation, from the sounds of it a simple empty rotation of 180deg in the axis thats backwards should do the trick :wink: