Edit Object TrackTo Actuator - Local Up Axis

Hi all first post,

I’m trying to understand how best to solve an issue with tracking in the game engine. I’m in the process of building a simple space game and am attempting to create a turret for a space ship, think turrets like in Eve Online e.g https://www.youtube.com/watch?v=Z15uMJF1H8Y
The turret consists of;

  • the base section: this needs to align towards the target, I want it to rotate on its own local ‘z’ axis, this is parented to the ‘gun controller’ empty that is itself parented to the spaceship.
  • the gun: this needs to be able to traverse up and down on its own local ‘y’ axis. This is parented to the gun controller empty.

Using the in-build ‘edit object trackTo’ actuator can accomplish the above provided the spaceship parent object doesn’t roll (the trackto up axis must be global as this doesn’t roll with the parented object) however I need the object to be able to rotate with the parent.
I have started looking into learning about euler and quaternions as a possible solution however given my fairly mediocre python skills it’s something I’d prefer to avoid if possible.:eyebrowlift2:
I’ve attached an example blend file below to illustrate…any help would be appreciated.

trackToExample.blend (634 KB)

Cheers,

Just an update on this I eventually solved it with python. Turns out it wasn’t nearly as complicated as I had led myself to believe.

I’ve added my file below if anyone stumbles across this and is having a similar problem

trackToExampleSolved.blend (709 KB)