How do you make an actor slow down and stop?

Popa WheeliePopa Wheelie Member Posts: 2
edited July 2012 in Working with GS (Mac)
Hi, ive made an actor so it accelerates to 50 when the right key is down. does anybody know how to make the actor slow down and then stop when the right key is up? ive tried a few ways but the actor just comes to an abrupt stop when right key is up. I would like the actor to slow down then stop. any help would be appreciated. cheers.

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    what behaviors are controlling the movement?

    accelerateBehavior is a Persistent Behavior
    unless MLV is at some point/time changed by event/attribute To: 0
    the MLV will persistently increase

    the Physics: Drag attribute slows actor's movement … usually to a stop

    Rule: when
    Event: key right is down
    -changeAttribute: self.Physics.Drag To: 0
    -Accelerate behavior
    Otherwise:
    -changeAttribute: self.Physics.Drag To: 50 (or lower/higher)

    Note: as default for right key is up … Drag is set to 50 at start of scene
    the changeAttribute: self.Physics.Drag To: 0 … is needed in the Rule

    image MH
  • Popa WheeliePopa Wheelie Member Posts: 2
    Genius, cheers for the help MH.
Sign In or Register to comment.