How do I lerp to an angle past 360 degrees?

0 favourites
  • 5 posts
From the Asset Store
Avoid obstacles and survive as long as you can!
  • Hello there o/

    I'm trying to make a menu system that's situated on a circle that rotates when you swipe up or down. When the user swipes the menu lerps to the nearest menu option that I've defined as intervals of angles (i.e. every 60 degrees) but when the circles rotates beyond 360 degrees it lerps in the reverse direction towards zero. What I'd like is the menu to continue lerping to and beyond 360 degrees but I'm stumped.

    Here's a link to a demo capx.

    Any ideas?

  • Might try replacing lerp with anglelerp.

  • <img src="smileys/smiley22.gif" border="0" align="middle" />

    I'mma go stand in the corner and feel sad for myself now...

    Also, thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Panacea - lol Don't feel bad, man. I've noticed that C2, despite its amazing ease of ACCESS, also has that odd effect of creating steep learning curves...namely in teachings us that the obvious is hardest to see when it's staring dead in the face.

    I'm very familiar with C2 now, but I'm STILL learning tons and facing lots of obstacles in the process. The celebration here is that now you've got something else under your belt of tricks. :)

  • There are no angles past 360 degrees - it wraps back to 0 degrees, which breaks the normal lerp. This is what anglelerp fixes - it knows about the wrapping.

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