Where am I going wrong here? Vector to angle then wait to launch
So I'm trying to launch my projectile from a cannon. I want to add a wait time for the cannon to rotate to the angle where the user taps so that the projectile comes out of the cannon. Otherwise the projectile launches instantly and it looks like it's coming out the side. What's wrong with what I'm doing?
http://www.flickr.com/photos/79061471@N08/7237421570/in/photostream
In my mind this looks like it should rotate to angle, when mouse is pressed down, wait .1 second(giving enough time for cannon to rotate), then spawn actor. No?
http://www.flickr.com/photos/79061471@N08/7237421570/in/photostream
In my mind this looks like it should rotate to angle, when mouse is pressed down, wait .1 second(giving enough time for cannon to rotate), then spawn actor. No?
Best Answer
-
tatiang Posts: 11,949
What is your full expression for the angle? By the way, if you click the expression editor, you can then move the expression editor window and take a screenshot showing the full expression.New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
My full expression for the angle is:
max(55,min(125,vectorToAngle(max(55,min(125,vectorToAngle( game.Touches.Touch 1.X - self.Position.X , game.Touches.Touch 1.Y - self.Position.Y )))