Track to problem

Hey all,

Here’s the thing,

I want to have a spaceship fly over a round, little, planet. To do this, I need him to track to the planet the whole time. So that he goes in circles around the planet. The problem is that I also need im to track to the mouse cursor.

I had a little script which made the cube turn so that it’s standing on the ground.

Hope you understand what I mean, explanation is my worst skill.

Thanks already. :wink:

I’m guessing that your view shows the ship making circular orbits of the planet, with one side of the craft always facing the centre of the planet. It might be that you want to use the position[0] or position[1] of the mouse cursor to influence it’s orbit in some way.

There’s a bunch of ways you can pass these variables to the ship. Also remember that you can set gravity to zero. Then you can apply “myGravity” to the ship by “Always” applying a force to the ship that is always directed in the direction of the centre of the planet. And the magnitude of the force can be a value that depends on the square of the distance between the centre of the planet and the ship.

You can do some really nifty orbit sims like this and not be restricted to a 2D view. Take off, land, achieve stable orbit etc. Steer left and right using “local”, blast enemies as they appear on the surface, that kind of thing. It’s handy if you can use a gamepad and even better if you can figure out how to script for it.

Slow parenting and vertex parenting are also handy to know, especially if you want to have following cameras. Also if you want something to track the mouse pointer or at least be influenced by it, you can have a invisible proxy object change it’s x,y location according to the x and y coordinates of the mouse and it’s z by the mouse wheel. Your real object can then “track to” the proxy object.