How do I tween rotation clockwise?

0 favourites
  • 4 posts
From the Asset Store
Calculate parabolic trajectories and tween objects over them.
  • Hello,

    I need to make a Sprite rotate towards a certain angle using an easing function for a specified duration. Additionally, I would like it to always rotate clockwise, even when it would involve to rotate for a larger amount.

    At the moment I am using the LiteTween Behavior (https://www.construct.net/en/forum/extending-construct-2/addons-29/behavior-litetween-48240). The problem I am facing is that if to reach the target angle the sprite needs to rotate for a smaller amount counter-clockwise, then it does it, while I want it to always rotate clockwise.

    Any ideas about how could I do it? Do you suggest an alternative Behavior/Plugin for tweens?

    Thank you in advance for your help! :)

  • You need to tween a value, say, from (sprite.angle) to (sprite.angle+200). And then while the tween is running, set sprite angle to Tween.value

    You can even make multiple rotations using this method - tween from 0 to 3600 will rotate the sprite 10 times.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You need to tween a value, say, from (sprite.angle) to (sprite.angle+200). And then while the tween is running, set sprite angle to Tween.value

    You can even make multiple rotations using this method - tween from 0 to 3600 will rotate the sprite 10 times.

    Thank you for your answer and sorry for the late reply: these days I'm very busy and I have little free time only during weekend.

    That's a good idea, but I don't know how to do it with LiteTween. Do you think it is a good addon or do you suggest me a better plugin/behavior for tweens?

    Thanks. :)

  • LiteTween is the greatest addon for tweening, you won't find a better one.

    Just set Tweened Property=Value, and set sprite angle to Sprite.LiteTween.Value on every tick while the tween is running.

    However, I just tested and it looks like you can do this by tweening the angle directly. Say, if you want to rotate your sprite 30 degrees clockwise, tween to (sprite.angle+30). If you need to rotate counter-clockwise, tween to (sprite.angle-30)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)