How do I kill platform inertia?

0 favourites
  • 3 posts
From the Asset Store
Wanting to do a Shot n Run game easily? Here is your chance!
  • I'm using the platform behaviour and have a character walking left or right.

    I then stop the player if they hit a button at a certain point like so:

    On Keyboard Press W

    Set Group "Movement Controls" Deactivated

    Set Platform Disabled

    Start ignoring Platform user input

    Tween Position to Location.Y

    And that moves the player to a new position perfectly.

    The problem comes when returning them to the Platform:

    On Keyboard Press S

    Tween Position to Floor.Y

    Wait for previous action to complete

    Set Group "Movement Controls" Activated

    Stop ignoring Platform user input

    Set Platform Enabled

    At this point, when the player has returned to the ground, their motion from their initial walking continues as if it was never interrupted. So if they were moving right before hitting W, they now go back to moving right after hitting S, until they decelerate and stop.

    Why is the movement carrying over? Is there a way for me to kill it upon the press of W?

    Thanks for any help.


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Set the platform vector x to 0

  • Worked perfectly, thanks BaconSwagg

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)