Make actor slowly stop after accelerating?

SikstenSiksten Member Posts: 16
edited November -1 in Working with GS (Mac)
How is this achieved? When I accelerate with my actor then release the key he keeps sliding. He wont stop even if I had friction..? I added "interpolate self motion y to 0" in the "otherwise"-section of the Up Key acceleration rule, but then while it interpolates, if ihit the down key, it ignores the interpolation and the actor slides up until the acceleration down begins? if this sounds messed up tell me i'll try to explain better

Thanks in advance

Comments

  • SikstenSiksten Member Posts: 16
    Nobody?? This is essential in many accelerator games..
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    you need to interpolate self.linervelocity.y or self.linearvelocity.x depending on the direction of travel
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    sounds a little messed up...

    You press a button he accelerates..

    I'm not on my GS machine right now, so cant remember what options accelerate gives you.

    Ok thinking outloud:

    Make a rule:
    if actor Y.velocity is < than you wanted max speed

    accelerate...

    If button is released

    make accelerate = 0.

    It should then slow down and stop moving (I think)..

    And will only accelerate up to your chosen speed..

    Note:
    I've been using interpolate too much recently. So can't quite remember if this correct for 'accelerate' or 'move'.
  • SikstenSiksten Member Posts: 16
    Fixed, thanks :)
  • msonesmsones Inactive, Chef Emeritus Posts: 75
    You can also use Drag. Check out this video: around the 1:40 mark.
Sign In or Register to comment.