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. Multiple collisions

Multiple collisions

Scheduled Pinned Locked Moved Help and Support
6 Posts 2 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.
  • BryanB Offline
    BryanB Offline
    Bryan
    wrote on last edited by
    #1

    Is it possible if obeject A and after Object B hits object C a action happens, but both needs to hit obeject C otherwise nothing happens. I‘m looking for something like a „and“ function.
    Thx very much for helpibg me.

    Jack de WildeJ 1 Reply Last reply
    0
    • BryanB Bryan

      Is it possible if obeject A and after Object B hits object C a action happens, but both needs to hit obeject C otherwise nothing happens. I‘m looking for something like a „and“ function.
      Thx very much for helpibg me.

      Jack de WildeJ Offline
      Jack de WildeJ Offline
      Jack de Wilde
      wrote on last edited by Jack8680
      #2

      @Bryan have an attribute or box container for each collided behaviour and set them to 0 to start with and then each collided behaviour sets their respective value to 1, and checks whether the other collided is set to 1. This is essentially your AND; if collided1 AND collided2 is true when the collided1 value is 1 and then the collided2 is activated, or vice versa. Here's a screenshot:
      0_1500132569278_IMG_3431.PNG
      The change input fields both set the value to 1.
      If you want it to be while they are colliding at the same time, use stopped colliding that sets the box container back to 0.

      BryanB 1 Reply Last reply
      1
      • BryanB Offline
        BryanB Offline
        Bryan
        wrote on last edited by
        #3

        @Jack8680 thank you very much. I didn't expect such a fast answer.

        The bad think is, I've tried it out and it hasn't worked.

        0_1500138113744_IMG_0041.PNG

        Do you know what's wrong? Thank you very much!

        BryanB 1 Reply Last reply
        0
        • BryanB Bryan

          @Jack8680 thank you very much. I didn't expect such a fast answer.

          The bad think is, I've tried it out and it hasn't worked.

          0_1500138113744_IMG_0041.PNG

          Do you know what's wrong? Thank you very much!

          BryanB Offline
          BryanB Offline
          Bryan
          wrote on last edited by
          #4

          found it!

          1 Reply Last reply
          0
          • Jack de WildeJ Jack de Wilde

            @Bryan have an attribute or box container for each collided behaviour and set them to 0 to start with and then each collided behaviour sets their respective value to 1, and checks whether the other collided is set to 1. This is essentially your AND; if collided1 AND collided2 is true when the collided1 value is 1 and then the collided2 is activated, or vice versa. Here's a screenshot:
            0_1500132569278_IMG_3431.PNG
            The change input fields both set the value to 1.
            If you want it to be while they are colliding at the same time, use stopped colliding that sets the box container back to 0.

            BryanB Offline
            BryanB Offline
            Bryan
            wrote on last edited by
            #5

            @Jack8680 And what would you suggest, if the amount of object is higher than 3?

            Jack de WildeJ 1 Reply Last reply
            0
            • BryanB Bryan

              @Jack8680 And what would you suggest, if the amount of object is higher than 3?

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

              @Bryan put all the objects in a tag (including object detecting the collisions), use a loop to count the number of objects in the tag (subtract 1 to exclude self), if number of objects colliding is equal to number of objects in tag except self ( can't collide with self), then the object is currently colliding with all objects in the tag. This is shown in the first screenshot:
              0_1500323488909_IMG_3503.JPG

              To detect whether the object has ever collided with each object instead of detecting whether the object is colliding with all at the same time is similar, but the object detecting the collision is instead given a unique ID based on a global variable (so you can have multiple detecting objects that don't interfere with each other). A dynamic attribute is applied to all objects in the tag that it collides with so it only counts each object once. This is shown in the second screenshot:
              0_1500323806119_IMG_3507.JPG
              The behaviours in both screenshots should work with spawned object and multiple detectors too, but if you don't have this they can be simplified down a bit (you don't need to count objects if you know how many there are and don't need and ID if there is only one object anyway.

              EDIT: to clarify, "set attribute" is the global variable, with a value equal to "ID (Add Values)", and "set attribute2" is a dynamic attribute with a value of 1 and the key "combine text".

              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