Hi guys, i'm having the problem that has been bothering me since the start of the project, and it's time to put it to an end.
Imagine this little fella is a spaceship with an engine jet behind him.
(]>
They are separate objects for the reason of only ship changing the color when he is hit (sprite masks are too complicated for this).
When the ship is moving from right to left, i set it's scale properly be getting if he's beyond a certain x position and the jet is rotated towards right. That's ok. When it's moving from left to right, i set the x scale of the ship to -1, the jet detects if engine is -x, and flips too.
But, there are certain situations when the rule is unnaplicable. Like when ship is spawned in the middle of the screen (from a carrier for example), and though the spawn location indicates one jet position, it should be placed on the other side.
There are lots of exceptions, too much to cover in a simple way.
I tried using Get Forward Direction, Get Speed, Get Velocity to get some parameters that could help me out, but i get nothing because the ships are moving either by tweening or by translate.
One idea i'm having is to get the x position of a ship and the position on the next frame and then compare them. If the new float is lower, ship is moving left, if it's higher, then it's moving right and the jet can be rotated accordingly. Unfortunately, this is also unnaplicable for the ship that are rotated either left or right but move only up or down.
Any good ideas on this one, i'm pulling my hair out for months.