[SOLVED] Delayed/controlable layer rotation lerp.

0 favourites
  • 3 posts
  • Hi,total Construct newbie here.

    I'm working on a small prototype for the compo and came across a little problem.

    Using the lerp method to ease out the layers rotation against the player angle, whenever I reach a delayed angle of "359" or "0" the layers are doing a whole revolution.

    It's quite logic and I thought it would be easy to constrain the rotation, but I failed to build something that works smoothly.

    Here's my basic setup.

    If someone could provide any hint it would be super welcomed :)

  • You have several answers to this problem in this topic.

    It's based on a sprite, but I'm pretty sure the same logic can be applied to the layer.

    Lerp alone is not good for angles.

    And welcome on the forums ^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks a lot for the quick answer !

    Works as intended using Yann's method.

    What I did on someone's capx

    <img src="http://dl.dropbox.com/u/23551572/C2/angleLerping.png" border="0" />

    If I remember I was smooth rotating the layout to align with the rotation of the Player (this Player.Angle)

    I don't think you need all these %360 though... I was just being too carefull

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