Actor rotate 360 degrees on center point

wolala123wolala123 Member Posts: 249
edited March 2016 in Working with GS (Mac)

How do an actor rotate on center point? Thanks.

For example, a cannon rotate around center point with 360 degrees.

Comments

  • ohtukrwohtukrw Sir doge Member Posts: 106

    Reviving this thread, if someone knows the answer please post.

    I want my moving hero to rotate once, 360 degrees around its centre point when space bar is pressed?

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

    @ohtukrw said:
    I want my moving hero to rotate once, 360 degrees around its centre point when space bar is pressed?

    When Space is pressed
    --Interpolate rotation to 360

  • ohtukrwohtukrw Sir doge Member Posts: 106

    @Socks said:

    @ohtukrw said:
    I want my moving hero to rotate once, 360 degrees around its centre point when space bar is pressed?

    When Space is pressed
    --Interpolate rotation to 360

    Like this?

    http://tinypic.com/r/k4z7f7/9

  • ohtukrwohtukrw Sir doge Member Posts: 106

    Still can't implement the control

  • NNterprisesNNterprises Member, PRO Posts: 387

    Try maybe to rotate to + or -359.999, maybe GS thinks 0 and 360 is the same so it's not moving it... Not sure

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

    @ohtukrw said:
    Still can't implement the control

    Can you describe the steps you went through to create the rule - and any other additional rules for the actor that might be effecting it ?

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

    @NNterprises said:
    Try maybe to rotate to + or -359.999, maybe GS thinks 0 and 360 is the same so it's not moving it... Not sure

    Interpolate is simply changing one value to another through all the intermediate steps, so it wouldn't really make any difference whether the target value was 360 or even 1440.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited July 2016

    This is how I would do it (demo attached):

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ohtukrwohtukrw Sir doge Member Posts: 106

    @Socks said:

    @ohtukrw said:
    Still can't implement the control

    Can you describe the steps you went through to create the rule - and any other additional rules for the actor that might be effecting it

    Here's the link:
    http://tinypic.com/r/k4z7f7/9

    Is this the way I should do it?

    There is accelerate attributes on the actor as well, but does that affect it though?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @ohtukrw said:
    Here's the link:
    http://tinypic.com/r/k4z7f7/9

    Is this the way I should do it?

    No. That will interpolate the rotation TO 360°. Not THROUGH 360°, which is what you want. See my demo above.

    There is accelerate attributes on the actor as well, but does that affect it though?

    Not sure what you're asking since you haven't explained what attributes and how you're accelerating the actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ohtukrwohtukrw Sir doge Member Posts: 106
    edited July 2016

    @tatiang said:
    This is how I would do it (demo attached):

    Awesome, thank you. :)

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited July 2016

    Oops... I made a slight error in the file. Forgot to store the starting rotation... one sec and I'll upload a new version.

    Edit: Okay, my post above has the fixed file and updated screenshot.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

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

    @tatiang said:
    This is how I would do it (demo attached)

    You can simply interpolate the rotation to 360 (or -360), you don't need the start rotation attribute.

    Example attached:

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

    @ohtukrw said:

    @Socks said:

    @ohtukrw said:
    Still can't implement the control

    Can you describe the steps you went through to create the rule - and any other additional rules for the actor that might be effecting it

    Here's the link:
    http://tinypic.com/r/k4z7f7/9

    I've seen that, I was asking if you could share the steps you went through to create the rule and any other rules the actor might have.

    @ohtukrw said:
    Is this the way I should do it?

    Looks to me like you created the 'rotation' attribute yourself ?

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

    @tatiang said:
    No. That will interpolate the rotation TO 360°. Not THROUGH 360°, which is what you want. See my demo above.

    It works just fine ! :) Honestly !!

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

    @Socks said:
    When Space is pressed
    --Interpolate rotation to 360

    It really does work if you try it !

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

    @Socks said:

    @Socks said:
    When Space is pressed
    --Interpolate rotation to 360

    It really does work if you try it !

    So I had to try it... and.... it works! :)

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

    @jamie_c said:

    @Socks said:

    @Socks said:
    When Space is pressed
    --Interpolate rotation to 360

    It really does work if you try it !

    So I had to try it... and.... it works! :)

    Yeeeaaahh ! At last a believer ! :smiley: You will be rewarded for your faith, not in this life, but probably in 1.25.62

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited July 2016

    @Socks

    It does work! But only if self.rotation starts at 0, right?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

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

    @tatiang said:
    @Socks

    It does work! But only if self.rotation starts at 0, right?

    Yes, it assumes a default starting angle of 0°, any other angle (or changing angles) and then I'd use your approach of a starting angle attribute.

Sign In or Register to comment.