Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. How to make trail effect?

How to make trail effect?

Scheduled Pinned Locked Moved Help and Support
7 Posts 4 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Wazk MobileW Offline
    Wazk MobileW Offline
    Wazk Mobile
    wrote on last edited by
    #1

    I’m wondering how to make objects follow each other with the function to add and subtract objects(making a trail like slither.io)

    1 Reply Last reply
    0
    • Michael KhalfinG Offline
      Michael KhalfinG Offline
      Michael Khalfin
      wrote on last edited by
      #2

      For each time an object moves another object can move the same amount of units up, down, left, or right?

      1 Reply Last reply
      0
      • Wazk MobileW Offline
        Wazk MobileW Offline
        Wazk Mobile
        wrote on last edited by
        #3

        Yeah but how do I make it so I can add more in game.

        1 Reply Last reply
        0
        • Michael KhalfinG Offline
          Michael KhalfinG Offline
          Michael Khalfin
          wrote on last edited by
          #4

          What do you mean?

          Just put all the regular behaviors, and when you do something to move the object or set a velocity or whatever, tag the object and the objects that are following it to move together.

          Jack de WildeJ 1 Reply Last reply
          0
          • Michael KhalfinG Michael Khalfin

            What do you mean?

            Just put all the regular behaviors, and when you do something to move the object or set a velocity or whatever, tag the object and the objects that are following it to move together.

            Jack de WildeJ Offline
            Jack de WildeJ Offline
            Jack de Wilde
            wrote on last edited by
            #5

            @GameCRAZY that wouldn't make a trail, they'd all move the same way. The easiest way I think is to use an array the length of the trail, every time the main object moves add its position to the front of the array and delete the last one. Start the array with the starting positions of the trail. Whenever you move, each part of the trail moves to the relevant part of the array.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              Deeeds
              wrote on last edited by
              #6

              Pivot Joints.

              Head (first circle) has a pivot joint some percentage from its centre towards the direction of the tail. Place the pivot joint here, attach the tail circle at this point, to its centre. Each subsequent tail section attaches to its "parent" at a point on the parent the same distance from the centre that was used on the head, in the opposite direction to that of the current movement.

              Some maths required to figure out where that is, math that is far beyond me.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Deeeds
                wrote on last edited by
                #7

                Here's an image describing the offset of the initial anchor point on the head, each subsequent tail section has its own anchor point moved the same distance in the corresponding inverse direction of travel:

                0_1509355788351_Image-1.jpg

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Search