How do I Move Object Smoothly ?

Get help using Construct 2

Post » Sun Jan 25, 2015 7:09 pm

Hello everyone !!

I want to move an object in X direction smoothly with this [lerp (Sprite2.X , Sprite2.X + 50, 0.6)] but it goes like woooosh :shock: and it is not smooth either !!!
how can I do this ? :?: :?:

thanks in advance !
B
5
Posts: 7
Reputation: 239

Post » Sun Jan 25, 2015 7:15 pm

yeah, it never reaches the point, like the turtle and Achilles...


@nXFiles :

you need a destination point, which must not be constantly relative to your Sprite.X.

Since lerp sets SpriteX every time adds (StartX-TargetX+50*0.1) to your Sprite's position. Always the same amount, constantly, whoosh ;)
Think of a dog, with a stick attached to the back, having a sausage hanging down in front of the nose.. or just the tail catching dog.. moving infinitely toward it, but never getting grab of it.

Try cosp by the way, eases in and out, works same way: cosp(Sprite.X, TargetX, 0.1)

Target can be mouse-pointer X, or screen corner, or whatever...
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Sun Jan 25, 2015 7:22 pm

Thank you so much @MultipleChoice !!!!
It worked like I wanted !!
B
5
Posts: 7
Reputation: 239

Post » Sun Jan 25, 2015 7:25 pm

Glad!
B
8
S
3
Posts: 197
Reputation: 1,207


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests