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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    I've found ways to make it rotate AFTER the touch/drag is complete - I don't want that

    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.

  • AdrenalineAdrenaline Member Posts: 523

    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!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @Adrenaline, report back when you have a look. :)

  • SocksSocks London, UK.Member Posts: 12,822

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    I made a quick demo, attached . . .

  • AdrenalineAdrenaline Member Posts: 523

    You, sir @Socks , are a beautiful human being. Thank you!

  • SocksSocks London, UK.Member Posts: 12,822

    @Adrenaline said:
    You, sir @Socks , are a beautiful human being.

    Yes, it's true.

  • ToqueToque Member Posts: 1,188

    @Socks said:

    @Adrenaline said:
    You, sir @Socks , are a beautiful human being.

    Yes, it's true.

    Are you single? My sister is interested.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2016

    @Toque said:
    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.

Sign In or Register to comment.