playMaker

Author Topic: Movement with accelerate and decelerate  (Read 3361 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Movement with accelerate and decelerate
« on: August 19, 2014, 12:46:07 AM »
Hi!

I have a simple horizontal movement. (See the picture)
I want to have an acceleration and decelerate on the movement. Like Mario
Is it possible to do this with this kind of movement? Or do I need to change the movement also?

I'm a little bit stuck with this. Is it possible to get some help, please? :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

600

  • Moderator
  • Hero Member
  • *****
  • Posts: 715
    • Flashing Lights
Re: Movement with accelerate and decelerate
« Reply #1 on: August 19, 2014, 02:39:31 AM »
Hi!

One way to do it is to set input gravity and sensitivity in Input Manager for Horizontal axis. Try low numbers like 3 or something, input should have a little delay so movement would slowdown and accelerate.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Movement with accelerate and decelerate
« Reply #2 on: August 19, 2014, 10:05:10 AM »
Hi!

That was a very easy way to do it. Thank you! :)

But, is it possible to change these with some Playmaker Actions?
For example change the gravity horizontal?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

600

  • Moderator
  • Hero Member
  • *****
  • Posts: 715
    • Flashing Lights
Re: Movement with accelerate and decelerate
« Reply #3 on: August 19, 2014, 11:04:36 AM »
I dont know about custom action for Input Manager, still a topic ahead to research :)

About the movement, if setting gravity in Input manager not quite what you after,
could try to Interpolate the Speed variable you have.
When Horizontal is pressed Speed goes from 0 to x Speed in x seconds, if axis released Get current speed and interpolate to 0.

Hope others can suggest you about how to change input stuff at runtime.