How do I interpolate between two co-ordinates

Get help using Construct 2

Post » Fri Mar 20, 2015 8:54 pm

I'm moving a sprite from one image point to another using a boolean switch, currently the movement is instantaneous - is there any way to make it a smooth transition?
B
55
S
17
G
8
Posts: 634
Reputation: 8,773

Post » Fri Mar 20, 2015 9:10 pm

The typical way would be to set the sprite's position using the system expression lerp(a,b,x), where a & b are your required positions & x is the interpolation factor (which goes from 0-1, & is usually a var that increases with time).

There's also Rex's MoveTo behavior - http://c2rexplugins.weebly.com/rex_moveto.html - which is what I'd recommend since it has a lot of handy event options.

Or this is a quite advanced tweening plugin: viewtopic.php?t=70700&start=0
B
27
S
12
G
1
Posts: 157
Reputation: 3,359


Return to How do I....?

Who is online

Users browsing this forum: Benjo11, Fasold and 2 guests