Velocity and impulse acceleration?

What I don’t like whenever I use the velocity function to control my character, the change in direction is instant without mass. I want the change in direction of my character react like the impulse function, where my character decelerates before changing the direction, the problem with that is the charakter accelerates endlessly (in the velocity function it doesnt)

Is there a workaround or a right solution?

2 Likes

You need to set a maximum number, for the impulse value.

There’s a major difference from Velocity and Impulse.
Impulse is easier to use for acceleration while Velocity sets the object to a consistent speed.

Do you want the player to accelerate?

A link or screenshot would be useful.

1 Like

Hi,
With max value do you mean just the number linked to a button press and sent to the impulse function? With that, the character accelerates endlessly but I just want it to accelerate until a certain speed is reached.
The problem with the velocity function is the change in direction of my character (sideways) is too fast, I want it to decelerate before it changes the direction which works with the impulse function.

1 Like

As, so you want it to be realistic, like drifting. Hmm… Over the months, I’ve experimented with different ways to make a maximum value for impulse.

@Flying_Fajita, I know you made one for our Vironia Racing base.
Give me a second, I’ll take a look.

Here it is! It’s the maximum speed bundle for the motorcycle.

1 Like

■■■■ I didn’t thought about the extractor function, I will try it out as soon as I can, thank you justplain.

1 Like

That’s just my Flowlab name, call me Ember.

you need some good character animations to make that, for code use “Velocity” with “Ease” to slow the caracter

2 Likes

Yeah I prefer using velocity because it feels more precise to use. As adonisaru said above though, Ease can also be used to transition from the current speed down to 0.

There is also a behavior called Motor that might work better for you, however I don’t know what type of movement you are trying to create.

3 Likes

I couldn’t make it work. For example when my character walks to the right and I press the left arrow button, only after it’s release the easy starts to count, not at the time I pressed the button. Am I missing something?

1 Like

works better with on-screen buttons or touch screen

yeh, although im not sure why those are 8, they should be 12…

1 Like

It’s a smaller sprite, this is from the motorcycle.

The Motor Behavior is exactly what you want.
You can then also change the Physics Drag in the game settings if you want objects to deaccelarate Faster.

2 Likes