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. Calculate Distance

Calculate Distance

Scheduled Pinned Locked Moved Help and Support
6 Posts 4 Posters 1.4k 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.
  • H Offline
    H Offline
    H34D SP4C3
    wrote on last edited by
    #1

    How do I calculate the distance from one object to another and also output that distance?

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

      There's a calculate distance behavior in logic. It might be found in the advanced category, but probably not.

      Anyway, just use that behavior to select two objects, and then drag its input value into another behavior or a box container.

      Aidan_FireA 1 Reply Last reply
      0
      • Michael KhalfinG Michael Khalfin

        There's a calculate distance behavior in logic. It might be found in the advanced category, but probably not.

        Anyway, just use that behavior to select two objects, and then drag its input value into another behavior or a box container.

        Aidan_FireA Offline
        Aidan_FireA Offline
        Aidan_Fire
        wrote on last edited by
        #3

        @GameCRAZY's solution will work as long as you never use the zoom screen behaviour (it will calculate the new distance between them when you zoom screen rather than their actual positions).

        1 Reply Last reply
        0
        • H Offline
          H Offline
          H34D SP4C3
          wrote on last edited by
          #4

          Thanks I dragged the input value from the distance behaviour into a box container and nothing happened.

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

            @H34D-SP4C3 Nothing is supposed to happen. You're just storing the distance value to use at a later time. When you're ready to utilize it, drag the box container's input value into a certain behavior.

            1 Reply Last reply
            0
            • H H34D SP4C3

              How do I calculate the distance from one object to another and also output that distance?

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

              @H34D-SP4C3 it depends on what you want to do with the distance. If you want to show it to the player, you could use it as a value in a set label behaviour. If you want to use it to do something when an object is in range of another, you could use it in an if, e.g. Check whether the distance is less than 5, if so shoot at it or something.

              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