How do I lerp to an angle past 360 degrees?

Get help using Construct 2

Post » Fri Apr 12, 2013 1:10 am

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.

http://sdrv.ms/XvfdZH

Any ideas?
B
6
S
1
Posts: 5
Reputation: 960

Post » Fri Apr 12, 2013 1:16 am

Might try replacing lerp with anglelerp.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Apr 12, 2013 1:18 am



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

Also, thank you.
B
6
S
1
Posts: 5
Reputation: 960

Post » Fri Apr 12, 2013 8:17 am

@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. :)
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Fri Apr 12, 2013 3:50 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580


Return to How do I....?

Who is online

Users browsing this forum: Ethan, makkancs, Marxally, Naightwolf, pierre244 and 15 guests