Rotating Actor by Touch
Hi there, I've got a simple idea for a mechanic that I can't make work. In the game I'm designing, the player controls a ship at the center of the screen which fires on enemies spawned from the sides. What I want is for the player to touch a place on the screen with their mouse, and for the ship to rotate quickly toward that point. Firing is handled by a seperate button entirely (Spacebar). I should add that the player also doesn't "move," but only rotates.
My question is. how can I accomplish something like this? It feels like it should be simple but I've tried a number of different behaviors and just can't get it to work.
PS: I've looked up this problem on the forums but all the discussions were quite old, and the demos/resources people offered had expired, and I couldn't quite find what I needed on youtube.
PSS: Just to re-iterate, I want to make a central, circular player-character in a fixed position rotate towards the angle that the player clicks on the screen.
Comments
@rwg0691, here is one way to do it. I've put some explanations in the behavior titles. If you have any questions let me know.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thank you so much, I'll try it out and write you!