How to rotate a layer gradually ?

Get help using Construct 2

Post » Mon Oct 21, 2013 10:37 am

Hi everybody,

I would like to know if it is possible to rotate a layer gradually because every times i tried to find something like that, the layer rotate abruptly.

Could you help me please ?

B
2
Posts: 1
Reputation: 152

Post » Mon Oct 21, 2013 10:41 am

lerp ? Not sure if I miss understood you but lerp could do what you want
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Mon Oct 21, 2013 10:59 am

To rotate the layer gradually you should set the angle every tick instead of once.

Example of one way to do it:

create a global variable: LayerNewAngle
Create a sprite

on sprite touched(or clicked)
-system set LayerNewAngle : Layerangle(0)+45

system compare two values Layerangle(0) < LayerNewAngle
- system set layerangle : layerangle+1

It is ofcourse possible to use lerp or other features to make it look even better, but fact remains the angle should be adjusted over time instead of in one go.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: rollyzz and 42 guests