# Path behavior acceleration

### » Sat Nov 05, 2011 7:06 pm

Hi i use behavior path but i need set acceleration. I have velocity and in event sheet set vhen is velocity higger than max speed then set max speed. but it does not work, pls help this is important not as previously questions.....
B
25
S
4
G
2
Posts: 318
Reputation: 2,501

### » Sat Nov 05, 2011 7:42 pm

I haven't used path behavior but to make something accelerate with a max speed a simple formula is    speed=clamp(speed+accelerationamount,0,maxspeed)
Spriter Dev
B
103
S
22
G
12
Posts: 3,285
Reputation: 17,151

### » Sat Nov 05, 2011 10:55 pm

I think velocity is constant, so you will have to set it to zero once your max speed is reached.
B
178
S
50
G
206
Posts: 8,692
Reputation: 127,727

### » Sun Nov 06, 2011 7:41 pm

I don't understand the question. You can set the acceleration with an action. What doesn't work? Or what happened and what did you want to happen?

You can limit the max speed with clamp like this:
+ Always
-> Sprite: Set Path Speed to clamp(Sprite[PathMovement].GetSpeed, 0, 'maxSpeed').

Also keep in mind that acceleration is directional. Positive acceleration accelerates toward the end of the path, and negative toward the beginning.
R0J0hound2011-11-06 19:43:35
B
100
S
38
G
134
Posts: 5,556
Reputation: 85,325

### » Mon Nov 07, 2011 3:42 pm

Ok thx i try it and then i will write
B
25
S
4
G
2
Posts: 318
Reputation: 2,501

### » Tue Nov 08, 2011 4:25 pm

I solved it, i had a fail i change acceleration and velocity, but thx :)
B
25
S
4
G
2
Posts: 318
Reputation: 2,501