How do I make characters follow

0 favourites
  • 6 posts
From the Asset Store
2d warrior machrom platformer game character assets
  • Sorry for poor english.

    how could i make this?

    imgur.com/niTe07B

    like snake.

    but each snakebody is a character.

    follow previous character's step.

    more characters and the team longer,characters would duplicate.

    thanks very much.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could use the "Path Finding behaviour.

    When character 2 is greater than 50 pixels away from character 1.

    Find path, move character 2 to character 1 position.

    When distance from character 2 to character 1 is less than 50 pixels away.

    Stop moving along the path.

    Sorry i can't be specific.

    I haven't used the path finding behaviour for a fair while, and have forgotten the exact code to use.

  • sorry about this

    i tried but it didnt work

    imgur.com/a/esnqF

    i think the problem is the event

    thanks

  • Thanks

    I found the Plugin end solved it

  • Pathfinding to have a character follow at a former location is a bit overkill and can take up quite a lot of CPU resources.

    You referred to snake. Originally, snake is a grid movement.

    It keeps all the locations of your characters (members) in an array.

    Each "tick" you update the position of the main character/head and position the next element of the body to the former position of the previous element.

    You pass this way through all the elements of body, position them accordingly and save each of their current position in the array.

    The next tick, you do the same.

    Depending on what movement system you are doing you can adapt it and do the same in Construct.

    Or otherwise, you can also Pin Behavior (set to "position" using a rope style) and pin the characters to one another, making a "chain" that is being pulled by the main/first character.

  • Thanks you very much.

    I can let the snake to grid movement,but the collision is confused.

    Still try .

    The picture is ideal

    https://imgur.com/sVUlv8a

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