[Solved] ...script a movement from A to B

Get help using Construct 2

Post » Fri Jan 10, 2014 2:21 pm

You could also have a look at the MoveTo behaviour, a third party plugin.
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

Post » Fri Jan 10, 2014 3:14 pm

I'll check that out as well! That could be helpful.. but since the last post i made earlier, I tried to forge ahead with LERP and this is what I came up with. It's an old post because I was having internet trouble earlier before relocating.

@littlestain, one other quick question with LERP. It seems like everything I do is very snappy.. very fast.. is there a way i can make the lerp transition/interpolation much slower?

https://www.dropbox.com/s/vn7i0l81md6hvs3/LerpTest1.capx.zip project file

http://part12studios.com/temp/Lerp

click the blue box to make it move to the next location.. see how it jumps? I'd like to ease that to be much much slower.

Thanks!
Caleb
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Fri Jan 10, 2014 3:22 pm

also yes I did check that plugin and it works great, That is a big help for sure. I'm surprised this isn't a standard behavior. Moving an object with some easing between two points is pretty basic and common stuff, but hey that's what plugins are for :)

but i would still love to understand if its possible to make LERP moves slower and if so how would it best be achieved. part12studios2014-01-10 15:23:35
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Fri Jan 10, 2014 3:39 pm

More explanation about lerp can be found in this topic

if you change the lerp value to a much lower one it will go slower.
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

Post » Fri Jan 10, 2014 3:53 pm

ImageImageImage
B
71
S
22
G
259
Posts: 3,793
Reputation: 143,702

Post » Fri Jan 10, 2014 6:00 pm

oh yea that's awesome @blackhornet.. that looks like it's a kind of "tweenlite" solution found in flash / html5.. that would add a lot of cool posibilties.

http://part12studios.com/temp/Lerp2 @LittleStain, yea taking it down to 0.05 got this result which is much more appropriate for the kind of speed I'd need.

Thanks!
Caleb
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Fri Jan 10, 2014 6:12 pm

I would advice setting it to 0.5*dt to make it framerate independant.
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

Post » Fri Jan 10, 2014 10:04 pm

lerp(Sprite.Y, ObjectY,(0.1*dt))

like this?    

seems to really slow things down.. part12studios2014-01-10 22:05:22
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Mon Jan 13, 2014 4:29 pm

Just a final comment, LiteTween is great. I've got it doing just about everything I could ask for so thanks again for that suggestion, but also lerp is a great tip as well that I suspect will come in handy when i don't want to get tied down with a lot of behavioral things to track and just want a quick and lean interpolation between two points.
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Previous

Return to How do I....?

Who is online

Users browsing this forum: Bootfit and 17 guests