TrackTo actuator on z and -z

Hello,

is there a fix for the trackTo actuator to work properly with the +z axis as the up axis and -z as the tracking axis?

I remember reading something like this somewhere but I can’t seem to find it.

Thank you.

don’t get me wrong but if +z = up, and you want it to track to -z that wont work.
1 axis can not track to 2 positions (up and to target) at a single time.

normally you keep +y as forward axis and +z as up. you can activate 3d tracking(the little 3d button behind it) maybe that helps with your problem.

or set +y as forward and +z as up, go to edit mode of the object and rotate the forward view to y+.

Hmm, maybe I understood that actuator wrongly…

My player has its up axis as the +z. Facing forward is +y and his right side is +x.
Now I want the player, when he is flipping around in the air to stabilize himself.
E.g. while performing some backflips in order to not get stuck upside down in the air I would use the track to actuator to position the -z axis to track the ground.

So he would point with the +z axis up and the -z axis tracking the ground.

I could switch all the axis of the object, but that would mess up all my game and at this stage, that’s probably to late…

Maybe someone has another solution for this kind of problem avoiding the trackTo actuator?

BPR wrote a script that would allign an object on collision with another object using Python, I wonder if that might work for you. Might have to modify it a little. Scroll down, and look for “Wall Sidle Fail”

My player has its up axis as the +z. Facing forward is +y and his right side is +x.

Is correct. so what is does is already what you are asking, it points +z up and +y forwards.
the problem is in the object/actuator itself, it does track (or tries to) but it does not give it any upforce, so when your character is on its back it wont jump first then tracking. so you can do a few things here:

  1. add a jump force when the player is on his back(etc.), get him into the air then activate trackto, it should put the player right side up again.
  2. dont toss your player but animate it, this way it will always land on its feet.
  3. use python, own.trackToAxis(‘tracking_axis’,‘up_axis’,‘turn_speed’)