#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# How can I change speed of actor without changing direction?

Posts: 388Member, PRO

My ball actor is launched with Accelerate Toward behavior at -3500 acceleration, how can I slow it down without making any change to direction? just let it fly off but with decreasing speed.

• Posts: 453Member

If you want to slow it down, can't you just make the Accelerate Toward behavior at -1000 instead of -3500. The only other way i can think of is changing both self.motion.linearVelocity.x and self.motion.linearVelocity.y by the same factor.
like if actor is clicked on or something divide both velocities by a same factor/number

• Posts: 388Member, PRO

@tintran said:
If you want to slow it down, can't you just make the Accelerate Toward behavior at -1000 instead of -3500. The only other way i can think of is changing both self.motion.linearVelocity.x and self.motion.linearVelocity.y by the same factor.
like if actor is clicked on or something divide both velocities by a same factor/number

i have it -3500 to start fast and i want it to slow down gradually by any speed.. i'll give your suggestion a try and let you know what happens

• Posts: 388Member, PRO

@Socks said:
As for slowing an actor down there are lots of ways to do this, if you were using a Move behaviour you could interpolate the speed down, or if you want to stick with Accelerate then you could simply increase the drag over time.

hmmmm, still can't believe i'm seeing a lot of letters, not just letters but words, not just words but sentences and not just dots like ..... hahaha

But joking aside, i'll give your suggestion a try, you know I will lol

• Posts: 388Member, PRO

@Socks said:
As for slowing an actor down there are lots of ways to do this, if you were using a Move behaviour you could interpolate the speed down, or if you want to stick with Accelerate then you could simply increase the drag over time.

I tried the move behavior, both of them, problem with those is once the time limit is done, and gravity pulls the ball, it comes down straight, no arch like a natural ball would.

• London, UK.Posts: 12,822Member

@Dell7730 said:
I tried the move behavior, both of them, problem with those is once the time limit is done, and gravity pulls the ball, it comes down straight, no arch like a natural ball would.

Time limit ? Gravity ?

• Posts: 388Member, PRO

yes, with time limit, and gravity... oh! are you asking what's the time limit and amount of gravity?

• Posts: 388Member, PRO

@Socks said:
As for slowing an actor down there are lots of ways to do this, if you were using a Move behaviour you could interpolate the speed down, or if you want to stick with Accelerate then you could simply increase the drag over time.

Finally got it, copied the formula used in Angry Birds without the powerups and so on, using Change Velocity and vectorToAngle. @Socks thanks again.

• Posts: 388Member, PRO

@Socks

Here's the gameplay demo of the game I'm about to publish...

• London, UK.Posts: 12,822Member

@Dell7730 said:
Socks

Here's the gameplay demo of the game I'm about to publish...

Looks very polished !

• Posts: 388Member, PRO

@Socks said:
Looks very polished !

I like it polished lol