Twitchy Follower

0 favourites
  • 6 posts
From the Asset Store
Player's Follower
$7 USD
30% off
Players follower. use it for anything which follows the player
  • I'm a complete beginner and I'm probably overlooking something very simple here, but I'd be really grateful for some assistance.

    I'm making a basic platformer in which the lead character is followed by an assistant. I've currently got the assistant to follow by having the system compare their x coordinates and set the action of the follower to left/right if he's too far away from the player or stop if he's within 20.

    It works perfectly except that if you keep walking while he is following you, his sprite 'judders' very noticeably while he walks. I adjusted it so that the game only checked the relative positions every few seconds (thinking that maybe the problem was that it was constantly checking and restarting his walk cycle) but it made no difference. Where am I going wrong?

    Thanks in advance for all help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would be hard to say without looking at the code.

    When the player isn't moving you could record his xy in a variable, then when he moves compare the distance of his current xy to the stored xy and if its say 100 or more update the stored xy again, then always have the follower move to the stored xy position.

    If the followers x is below the stored x then play right animation, if its more then play left animation.

  • Thanks for the quick reply! I'll try that.

  • Unfortunately, the problem is still there however I get him to move.

    The juddering only occurs when the assistant is following the player at the same time as the screen is scrolling (it's set to follow the player). When the backdrop is stationary (at either end of the level) there is no problem.

  • I don't know if this is any use, i just made it.

    example

    I havent used platform behaviour before and i don't know what method you are using so maybe some thing like this.

  • Wow! Thanks very much for taking the time to do that. I'll try using that method straight away. Much appreciated.

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