Search Unity

Fast velocity increase but slow decrease with force

Discussion in '2D' started by captnhanky, Mar 20, 2019.

  1. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    I need for a sideways 2D space shooter game a spaceship that increases x velocity instandly when a button is pressed but decreases x velocity slowly when the button is released.
    I need the actual velocity to be read out of the rigidbody for further calculations (for the enemies to pre-aim at you)..so therefore I think I need some kind of addforce here..

    How could this be done?

    Thanks
    Andy