How do I make a sprite chase the player and decelerate AFTER passing the player?

0 favourites
  • 4 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • In a 2d sidescroller, I want something similar to how the ghost moves in the 'relic hunter' example. However, in my game the player can 'duck', and when they do I want the ghost to miss the player and fly past them, decelerate, and then accelerate back towards the player again. It doesn't seem like Follow behavior supports acceleration / deceleration like this. I also tried setting the ghost position to the player's using lerp to calculate the x/y, but the ghost starts to decelerate before getting to the player.

    Thoughts on how to do this?

    Thanks

  • Use the bullet behavior. Accelerate towards the player position slowly, every tick.

  • Thanks, but the problem is the enemy doesn't decelerate when passing the player, instead it maintains 100% speed on the turn. And I can't access the bullet vector speed of the enemy object. Am I missing something?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry! My mistake. It was the custom movement behavior that had the accelerate towards position action, not bullet. It should preserve momentum as the object overshoots the target, and gradually decelerate/accelerate back towards the target.

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