[SOLVED] Delayed/controlable layer rotation lerp.

Get help using Construct 2

Post » Wed Feb 08, 2012 3:45 am

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 :)lukke2012-02-08 17:08:18
B
19
S
5
G
2
Posts: 4
Reputation: 2,504

Post » Wed Feb 08, 2012 6:45 am

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 ^^Kyatric2012-02-08 06:45:26
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Wed Feb 08, 2012 5:06 pm

Thanks a lot for the quick answer !
Works as intended using Yann's method.

[QUOTE=Yann] What I did on someone's capx


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[/QUOTE]
B
19
S
5
G
2
Posts: 4
Reputation: 2,504


Return to How do I....?

Who is online

Users browsing this forum: Nifl and 30 guests