I need to shoot in 360 degrees. I'm using trig right now, but my formula isn't working.
Always Set X position to X("bullet")+cos("gun"))*15 and Set Y position to Y("bullet"-sin("gun"))*15.
The gun is shooting in odd directions and when change my angle the bullets angle changes as well how can I alter the formula and/or events to make this work?
I've worked 3 hours on this trying different articles on here, but none of them work or are specific enough to get me to make them work.
It should sort of work like that, but I don't get what "gun" is in your formula. What does cos("gun") mean? The gun's direction? Position? It should be the angle in 360 degrees, and not the direction in MMF direction numbers.
It does more than 360 degrees
The main reason I made it in Lua was because it's just much easier to put formulas into it. (X1-X2) is simpler than XPos("Active1") - XPos("Active2")
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Originally Posted by Muz It should sort of work like that, but I don't get what "gun" is in your formula. What does cos("gun") mean? The gun's direction? Position? It should be the angle in 360 degrees, and not the direction in MMF direction numbers.
Oh sorry I meant to put in cos(angle("gun")).
Thanks Nim the example helped me alot I got it working now.