Setting angle for a vector movement
I am creating a game in which comets rain down on a city and you have to shoot the comets out of the sky. I only have one direction for the comet and I am changing the angle based on the vector direction of the comet. I am using the equation
"DirToAngle( "Clickteam Movement Controller", VEC_Dir( "Clickteam Movement Controller", Fixed( "Comet3" )))"
The angles this creates are very random. Even two comets moving in the same direction can have completely different angles.
Re: Setting angle for a vector movement
Probably need to see an example to ready help but ensure you set velocity / speed before using angles. If moving at close to zero getting angles can have odd effects.
Re: Setting angle for a vector movement
Yes, the comets are moving at a very slow pace. Here is a stripped down version of the game.
Example
Re: Setting angle for a vector movement
Replace your set angle with:
VEC_Dir( "Clickteam Movement Controller", Fixed( "Comet3" ))+90
The DirToAngle is used to convert an angle in degrees to the closest 32 dir in MMF, so in this case you don't want that, you want the angle in degrees anyway.
As the MMF image rotation has 0 as directly up rather than the positive x-axis you need to add 90 degrees to correct for the difference in implementation.
Re: Setting angle for a vector movement
PS I recommend you use:
VEC_Dir( "Clickteam Movement Controller", 0 )+ 90
Using 0 rather than the objects fixed value tells the extension to use the last set object, it makes using the same code over again easier as you can copy and paste without worrying about the name of the objects.
Re: Setting angle for a vector movement
Thank you, that works fine.