Help - Offset Rotate without time constraints?

supafly129supafly129 Member Posts: 454
edited February 2015 in Working with GS (Mac)

I'm trying to get an actor to rotate 90 degrees along a fixed point, but only when it is pressed. I know @Socks and @RThurman were nice enough to cover this kind of stuff in the forums numerous times, and attached/below is an example courtesy of @Socks similar to want to achieve, I just cant get it to work the way I want since all of the demos I've downloaded involve constraints to timers and substituting it for a custom integer attribute didnt work (I do not want it to constantly rotate). Any ideas?

http://www.mediafire.com/download/18rjqung6lcu2it/rotateX.zip

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Will this work for you?

  • supafly129supafly129 Member Posts: 454
    edited February 2015

    @RThurman said:
    Will this work for you?

    @RThurman Not quite, I'm trying to get the actor to rotate an additional 90 degrees every time "touch is pressed" as in the following example. The only difference is I want the white dot to stay in place like the image I posted above (so that the actor rotates from a fixed point).

    Updated Game Project - [DOWNLOAD]

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

    @supafly129 said:
    all of the demos I've downloaded involve constraints to timers and substituting it for a custom integer attribute didnt work . . .

    Not at my computer right now, so can't look at your file, but can't you simply use a value for the angle that interpolates through a value of 90 when you press it ?

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    Example file attached, click on the screen to rotate . .

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

    @RThurman said:
    Will this work for you?

    Excellent !! :)

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    @supafly129 said:
    Not quite, I'm trying to get the actor to rotate an additional 90 degrees every time "touch is pressed"

    Maybe something like this?

  • MarpCarkMarpCark Member Posts: 121

    Im not very good with all this maths and angles and stuff, so i just double the image length and make the other half invisible so that it rotates on the middle (aka where the end of the visible image is). At least thats the method im using. Would be nice if GS released movable rotation anchor points.

  • supafly129supafly129 Member Posts: 454
    edited February 2015

    @MarpCark Yeah my only issue would be that if another actor collides with the invisible part, it would still trigger my rules but thanks for your input!

    @Socks @RThurman thank you both for your help! This is exactly what I was trying to do :) i really need to brush up on my trig!

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    @Socks said:
    Excellent !! :)

    Right back atcha' good buddy!

    @MarpCark said:
    Im not very good with all this maths and angles and stuff, so i just double the image length and make the other half invisible so that it rotates on the middle (aka where the end of the visible image is). At least thats the method im using. Would be nice if GS released movable rotation anchor points.

    I agree. That is a tried and true method for making the rotation point come out just right. (I probably use the method you describe more than any other solution.)

    @supafly129 said:
    @Socks @RThurman thank you both for your help! This is exactly what I was trying to do :) i really need to brush up on my trig!

    You are welcome! You don't really need to study trig to use this. Its all set up, all you need to do is change the 'pivot point' coordinates to whatever you want and the move behavior will always do the rest for you. In your case, the pivot point is 0,-35.5. You could change those coordinates to any other pivot point, and it will pivot around the new set of coordinates without you needing to make any other changes.

    You can also use any other rotation method, all of them work with this setup.

Sign In or Register to comment.