How do I set potition smothly

Get help using Construct 2

Post » Sun Jun 08, 2014 5:25 pm

Hi I have some objects that one can drag, If one place them wrong they are set potition to a othe object.
what I wonder if this can be slower motion when the object moving?

I use as action: set potsition to a other object

Thanks
B
13
S
3
G
1
Posts: 36
Reputation: 908

Post » Sun Jun 08, 2014 8:11 pm

Maybe use the lerp expression? Use the action set position and type lerp(self.X, ThePositionYouWantToGo.X, some value between 0 and 1) for X and lerp(self.Y, ThePositionYouWantToGo.Y, some value between 0 and 1) for Y.

For example, it should look like this:

X----> lerp(self.X, 100, 0.1)
Y----> lerp(self.Y, 100, 0.1)

... and your object will gradually go from it's current position to 100, 100 coordinates.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Wed Jun 11, 2014 8:35 am

I cant get it to work so i guess i am doing somthing wrong.
I tested:

PB1 is a other sprite

lerp(self.X,PB1.X,0.5) and for Y. This only make it go hafe way but same speed as normal.

If i increse 0.5 to 1 it go allway but till same fast speed.

Thanks
B
13
S
3
G
1
Posts: 36
Reputation: 908

Post » Wed Jun 11, 2014 11:14 am

hmmm... That's probably because the set position action is on an event that acts as a trigger and it only fires once.

Check the following capx!
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Tue Jun 17, 2014 9:23 am

Thanks Now i understand how that works and i do so nicly
Thanks
B
13
S
3
G
1
Posts: 36
Reputation: 908

Post » Tue Jun 17, 2014 11:16 am

You are welcome!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 32 guests