interpolating rotation to constant rotation

themagicboxthemagicbox Member, PRO Posts: 82
edited June 2013 in Working with GS (Mac)
i have a non movable actor i would like to keep spinning at a constant rate. i found a rule on the forums that i could interpolate rotation to 360 if self rotation equals 0...i tried it and it only spins once. when i try interpolating it to -360 it works spinning the other way constantly. I get why its spinning the other way but i dont know why it doesnt constantly spin when i use 360....

anyone else had this problem? is there another way i can keep it spinning (preferable without using a timer)

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    edited June 2013
    Just drop in the behaviour 'rotate' and set the speed. Ah wait just reread your text. . Non movable actor. One sec...

    You can do it with a two rule setup in the actor.. (There's definitely a tidier way...but its late as usual... ).. So for the time being this might suffice.

    rule 1
    if self.rotation = 0
    interpolate rotation to 360
    duration 1 second

    rule 2
    if self.rotation = 360
    change rotation to 0



  • BBEnkBBEnk Member Posts: 1,764
    Actually you only need the 1st rule because 360 is 0.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Just drop in the behaviour 'rotate' and set the speed. Ah wait just reread your text. . Non movable actor. One sec...

    You can do it with a two rule setup in the actor.. (There's definitely a tidier way...but its late as usual... ).. So for the time being this might suffice.

    rule 1
    if self.rotation = 0
    interpolate rotation to 360
    duration 1 second

    rule 2
    if self.rotation = 360
    change rotation to 0

    thank you thank you thank you thank you thank you!!!!!
    I don't know why I never thought of this before, but this is the missing puzzle piece I needed to bring A Long Way Home to the windows 8 store. Every object I had rotating from 0 to 360 was rotating once and then stopping. Adding that second verification rule fixed everything.

    I saw this post tonight and after 5 minutes of work I was able to go from 'not a chance' to 'it'll be ready soon'.

    now, I just need to apply the rule to 100 instance actors :( for the last remaining piece. Time for some find and replace in the XML :)
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    @jonmulcahy sometimes it's the simple ones that get you. Glad it's helped out especially on A Long Way Home which I loved on my iPhone. Hope all works out with the windows release.

    J
Sign In or Register to comment.