Rotate actor based on drag anywhere on screen
Hey guys, I feel like this should be very simple but I'm struggling to get the exact results I'm looking for.
I have a circle actor on screen. I want the player to be able to rotate that circle actor around its center point by dragging their finger anywhere on the screen. Drag left to rotate CCW, drag right to rotate CW. Drag quickly to rotate quickly, or slowly to rotate slowly. If I can manage to get this working, I may even want the circle to gradually come to a stop after the drag is complete, rather than a hard stop.
I've found ways to make it rotate to where the player's touch is - I don't want that
I've found ways to make it rotate AFTER the touch/drag is complete - I don't want that
Can someone point me in the right direction? I'm sure it's a "d'oh!" fix.
Thank you!
Comments
What Behaviors are you using to do that? It might be as simple as using a Constrain Attribute instead of a Change Attribute. Constrain would continually update the rotation as you drag. Of course this depends on how your Behaviors are actually set up.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
I'll have to look at my file when I get home. I'm just day dreaming about my problem at work right now, haha.
Thanks for the reply!
@Adrenaline, report back when you have a look.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
When mouse button is Down
--Change A to mouseX
--Constrain angular velocity to -(mouseX-A)
. . . . . .
'A' is a real attribute, also set Angular Drag for the actor to 2.
I made a quick demo, attached . . .
You, sir @Socks , are a beautiful human being. Thank you!
Yes, it's true.
Are you single? My sister is interested.
I'm pretty choosy, does she have both her own eyes ? Also she'll need to have a goat licence.