Moving object from A to B without slowing stop

Get help using Construct 2

Post » Mon Jun 25, 2012 1:31 pm

Hi, i used lerp to make an object moving from A to B.

My event is: Always --> object Set X to lerp(object.X,300,2*dt)

The problem is i don't want it to slowly stop when closer to the target. I want it to moving at the same speed and stop immediately.

Which is the best solution for this?
B
19
S
5
Posts: 51
Reputation: 1,883

Post » Mon Jun 25, 2012 2:13 pm

what about bullet behavior ?
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Mon Jun 25, 2012 2:39 pm

Bullet behavior is a painful choice. I used bullet before, it'll cause trouble when the game run on low fps.
B
19
S
5
Posts: 51
Reputation: 1,883

Post » Mon Jun 25, 2012 4:42 pm

ok there is a way to this but need some variables :

you need a variable (boolean) for the object so when he reach the distance it will be true. (we call it reached)
event1:       
        condition1:everytick.
        condition2:object X is reached (boolean = false)
        action:object:move at angle -> angle=(direction),distance=(1)

            
event2:
             condition1:object X is reached
             condition2:object compare x -> (300)
             action: set boolean true
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Mon Jun 25, 2012 6:18 pm

Thanks, i'll see what i can do with it.
B
19
S
5
Posts: 51
Reputation: 1,883


Return to How do I....?

Who is online

Users browsing this forum: YoHoho and 18 guests